Error “Dependent package with key emulator not found” while updating Android SDK and tools

安稳与你 提交于 2019-11-27 01:01:46

问题


I tried to update my Android Studio and got this error. How can I fix this?

I don't have much experience with Android studio and Android app development.

I am using Android Studio 2.3 and Linux.


回答1:


This worked for me as this post try: Update 2 https://stackoverflow.com/a/42735118/5133603

Update 2:

Solution to emulator package issue!

After digging in the repo's XML for a while I've spotted the issue.

It turns out that the "emulator" package is only in channel 3 (canary) while the "tools" package is in channel 0 (stable) but depends on "emulator". The solution is to force the manager to download the "emulator" package from channel 3:

./sdkmanager --channel=3 emulator

Problem solved!




回答2:


This is what worked for me:

  1. Download the command line tools, place them in the SDK folder (e.g., on mac: /Users/user/Library/Android/sdk), and then add the bin folder to the PATH.
  2. Install the latest platform: in a terminal, execute sdkmanager "platforms;android-25"
  3. Open Android Studio, and go to the SDK Manager (Appearance and Behavior > System Settings > Android SDK)
  4. Click on "Edit", and then select the sdk folder. Then "Next" > "Next" > "Finish".

I hope this works for you too.




回答3:


Temporarily change update channel to Canary Channel (Settings > Appearance & Behavior > System Settings > Updates). It works for me (Windows, Android Studio 2.3) I hope, this bug will be fixed in the next version of Android Studio.




回答4:


  1. Start "Android SDK Manager" from this path:

    %Android_home%\SDK Manager.exe
    
  2. Install all updates from this manager.

P.S. This worked for me.




回答5:


My solution using Void Linux (it should fix for other distributions too):

  1. Create a new folder named Sdk in this exact path. Bash example: $ mkdir $HOME/Android/Sdk

  2. cd to this folder, and download the latest SDK command line version. Bash example: $ curl https://dl.google.com/dl/android/studio/ide-zips/2.3.0.8/android-studio-ide-162.3764568-linux.zip

  3. Extract the android-studio-ide-162.3764568-linux.zip. It must be this way: $HOME/Android/Sdk/tools

  4. Launch Android Studio, and then proceed with normal installation.

PS: If you don't have a Android folder on your $HOME, you should create it, and then make the steps 1, 2, and 3, select the $HOME/Android/Sdk Folder in Android StudioConfigure → *SDK Manager → Edit, and proceed to step 4.




回答6:


This is what worked:

  1. Download the command line tools and place them in the SDK folder (on mac:~/Library/Android/sdk).
  2. Install Android studio 2.3 (on mac: /Application/Android Studio.app)
  3. Add path to java in Android Studio (export PATH=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin:$PATH)
  4. Set JAVA_HOME (export JAVA_HOME=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home)
  5. cd to ~/Library/Android/sdk/tools/bin and execute ./sdkmanager "platforms;android-25"
  6. Accept the license - this will install the android-25 platform
  7. Launch Android Studio, and goto the SDK Manager. The SDK Manager will now recognize the SDK path (~/Library/Android/sdk).
  8. Now install the rest of the tools.



回答7:


This fixed it for me (on a fully-patched Ubuntu 16.04 (Xenial Xerus)).

Disclaimer: I cleaned up everything beforehand:

rm -Rf ~/android-studio/ ~/.AndroidStudio2.2/ ~/.android/ ~/Android/

Then:

  • wget https://dl.google.com/dl/android/studio/ide-zips/2.3.0.8/android-studio-ide-162.3764568-linux.zip
  • wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
  • unzip android-studio-ide-162.3764568-linux.zip -d ~/
  • mkdir -p ~/Android/sdk
  • unzip tools_r25.2.3-linux.zip -d ~/Android/sdk
  • ~/Android/sdk/tools/bin/sdkmanager "platforms;android-25"
  • ~/Android/sdk/tools/bin/sdkmanager --channel=3 emulator
  • ~/android-studio/bin/studio.sh
  • Click "Configure" in the launch window
  • Select "SDK Manager" in the menu
  • The list on the right shows "partially installed" for API level 25
  • Click "Edit" on the right of "Android SDK Location"
  • You get the warning "an existing Android SDK was detected wizard will only download missing or outdated SDK components"
  • Click "Next"
  • Click "Next"
  • [wait while it installs]
  • Click "Finish"



回答8:


Just delete the directory C:/Users/%user%/AppData/Local/Android/sdk and rename the other directory in that location from sdk1 to sdk. Restart Android Studio (close projects) and an assistant will pop-up asking you to update the sdk which will be detected during that process, so a re-download won't be necessary.



来源:https://stackoverflow.com/questions/42732684/error-dependent-package-with-key-emulator-not-found-while-updating-android-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!