问题
I wasn't able to install an emulator to my android studio installation so I copied this link from the studio and downloaded the zip file...Now, how to install it with this given zip file
https://dl.google.com/android/repository/sys-img/android/x86_64-25_r03.zip
回答1:
I had a problem downloading the Emulator(Image files) from the android studio. So when you try to run your app witout an emulator. It asks for an option to create a new emulator wherin it'll download the required files. It use to download 60-70% and give error. So I used the link in the download dialogbox, and manually downloaded the zip file. Now that zip file needs to be extracted and has to be pasted in the sdk folder.
sdk/system-images/android-(api level)/(extracted folder)
Note:This is my first thread so You might suggest some improvements
回答2:
I think francis-bacon solution is right (I don't see why you would install the emulator in a system image folder as faizann-gagan wrote) but it is partial: you may have noticed that many components of the SDK has a package.xml file. Platforms, docs, tools... Without this file, the SDK manager will show the component as missing as long as it is not present.
Problem is, when you unzip the emulator package, you won't find a package.xml. (I guess it is added by the SDK manager upon installation completion)
I could get a copy of this file from a backup and modified the version number to match the one in source.properties (at the time of writing, 29.0.11) An old package.xml can be found at https://chromium.googlesource.com/android_tools/+/refs/heads/master/sdk/emulator/package.xml also.
Confirmed working on Mac OS High Sierra and Windows 8.1
回答3:
When I launch the avd, I got the following error:
Emulator: Could not launch '/Users/gongzelong/Downloads/sdk/emulator/qemu/darwin-x86_64/qemu-system-i386': No such file or directory
I entered SDK-> Android Emulator in Android studio, and try to download Android Emulator.
But I got the following error when downloading it.
To install: - Android Emulator (emulator) Preparing "Install Android Emulator (revision: 27.3.9)". Downloading https://dl.google.com/android/repository/emulator-darwin-4899998.zip An error occurred while preparing SDK package Android Emulator: Cannot download 'https://dl.google.com/android/repository/emulator-darwin-4899998.zip': /var/folders/gf/hgd91n6x5v73ct9dvhr379500000gn/T/PackageOperation02/emulator-darwin-4899998.zip (No such file or directory) , response: 200 OK. "Install Android Emulator (revision: 27.3.9)" failed. Failed packages: - Android Emulator (emulator)
Here is how I solve the problem.
I downloaded the file https://dl.google.com/android/repository/emulator-darwin-4899998.zip from Chrome and unzip the zip and got the directory 'emulator'
Then I copy the emulator under sdk
And then launch the AVD in Android studio, and everything works well.
回答4:
So I faced almost similar error today but it was about updating the emulator itself. Cause was the folder Android tried to download the file needed root permissions to access it. So here is what I did:
- Downloaded the file in the directory accessible
curl https://dl.google.com/android/repository/emulator-darwin-4899998.zip -o emulator-darwin-4899998.zip
- Create the path as root user
sudo mkdir -p /var/folders/8t/kf42z0w94278zwm6x_wzll7c0000gp/T/PackageOperation03/
- Make it writable by everyone
sudo chmod -Rfv 777 /var/folders/8t/kf42z0w94278zwm6x_wzll7c0000gp/T/PackageOperation03/ /var/folders/8t/kf42z0w94278zwm6x_wzll7c0000gp/T/PackageOperation03/
- Move the downloaded file to the path
mv emulator-darwin-4899998.zip /var/folders/8t/kf42z0w94278zwm6x_wzll7c0000gp/T/PackageOperation03/
- Finally run Android Studio update check and let it update. It will check existing file and use that one to update instead of re-downloading
回答5:
The Answer works as well, if you have only 4Gig of swap memory available and AVD unzips into [/tmp] untill it's full, leaving it that way after throwing an out of disk space error.
So, one need to have at least (3.2+0.75) ~= 4Gig of real free virtual memory to install via AVD.
I stress this only, because I did a distro upgrade after that (...), and it rendered the system unbootable.
回答6:
I have also had the same error of the emulator failing to install from android studio. I tried downloading the zip and extract it in the SDK as per the top solutions It also didnt work. I just fixed it by allowing android studio through windows firewall and controlled folder access now it downloaded successfully in android studio
回答7:
I'm on Android Studio 3.5.3. After emulator update 29.3.4, I also got a similar error to above when trying to install emulators (I tried Pixel 3 and 2):
*Packages to install:
- Google Play Intel x86 Atom_64 System Image (system-images;android-28;google_apis_playstore;x86_64)
Preparing "Install Google Play Intel x86 Atom_64 System Image (revision: 8)".
Downloading https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-28_r08.zip
An error occurred while preparing SDK package Google Play Intel x86 Atom_64 System Image: Cannot download 'https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-28_r08.zip': Read timed out
, response: 200 OK.
"Install Google Play Intel x86 Atom_64 System Image (revision: 8)" failed.
Failed packages:
Google Play Intel x86 Atom_64 System Image (system-images;android-28;google_apis_playstore;x86_64)*
On first attempt I assumed it was an internet problem (I was using mobile internet, allowance of 6GB, 2-3GB left, though each failed downloaded used 0.5GB :-( ) but by the third attempt I was doubtful that was the problem.
I tried downloading the zip manually but just got a 404 error. Also I can't find the folders mentioned above (18 months on, different version no doubt).
I tried again on wifi, but running Android Studio as Administrator and this time it was successful. With trying 2 different things at the same time (wifi rather than mobile, running as Administrator) I can't be 100% sure which was the correct solution (and with it consuming so much data each time I don't want to make too many attempts) but running as Administrator seems to me the most likely.
I'll try to confirm once I get chance to buy more mobile data.
来源:https://stackoverflow.com/questions/41311344/installing-android-emulator-in-android-studio-with-zip-files