Error "Dependent package with key emulator not found" while updating Android SDK and tools
Asked Answered
M

9

48

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.

Screenshot

Medicament answered 11/3, 2017 at 7:38 Comment(4)
On what OS are you running Android Studio?Godparent
I am using Linux Ubuntu 16.04 LTSMedicament
Full StrackTrace: i.imgur.com/gIS2hhd.pngSorosis
Even with android-studio 2.2.x i get the same error. Android-studio 2.1.x seems to workSorosis
M
23

This worked for me as this post try: Update 2 https://mcmap.net/q/35964/-android-studio-error-an-error-occurred-while-trying-to-compute-required-packages

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!

Medicament answered 11/3, 2017 at 16:32 Comment(6)
The above solution works! For Mac users cd to "/Users/[user]/Library/Android/sdk/tools/bin/" to find sdkmanager.Guaco
What file does ./sdkmanager --channel=3 emulator get copied into?Charmaincharmaine
@Charmaincharmaine you have to enter that command into a terminal. First you have to navigate in your terminal session to the directory where the command is located as Theodoros80 stated. Then you should execute "./sdkmanager --channel=3 emulator"Ambo
Worked here as well. As a small footnote, remember you can do the same by Checking Updates inside Studio. Instead of clicking to update, immediately click the link in the dialog to change the channel to Canary. When you click OK and go back to the Update dialog, and click Update, the update will proceed normally. Anyway, just in case you are already inside studio and don't want to fiddle with the command line (which isn't difficult, as you can see). Just another way.Estrange
@DavidCesarino Yes, you can change channels but that means that you will update everything to canary (unstable) which isn't recommended. With the above command only the missing "emulator" package is updated wile the rest stays in channel 0 as it should be. Having said that, perhaps you could change channels temporarily with the gui, select only the emuator update and then revert back to channel 0.Ambo
Yes, I noticed only the emulator appeared when changing to canary, so no harm there. But of course, I completely agree that selectively updating only the emulator while keeping the stable channel during the whole time is way more appropriate (and elegant as well). :)Estrange
W
10

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.

Windowshop answered 11/3, 2017 at 9:23 Comment(2)
It is still spitting out errors when trying to update SDK Tools from 25.2.3 to 25.3.1 even when I manage to install the command line tools and open SDK Manager in Studio: "Unable to resolve dependencies". All other SDK packages seem to be working/downloading just fine, so this seems a good solution in case you can work with 25.2.3.Estrange
It is said to download the command line tools from a link. But the link leads to the Android Studio site from where we can download different versions of Android Studio for Windows, Mac, Linux and Chrome OS. Question is, where are the supposed command line tools to download? Can someone please clarify? Also, please explain how to execute sdkmanager in Windows 7 command prompt. Can we run it in the default prompt of CMD, or shall I have to cd to some other directory? Android Studio's installation process is undesirably complicated. Google must look into it.Cephalization
V
6

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.

Vulgate answered 11/3, 2017 at 17:30 Comment(0)
A
1
  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.

Aruba answered 11/3, 2017 at 13:48 Comment(1)
Actually this was helpful because the sdk manager (just type 'android' on the command line to run) manages to update all the other components successfully except Android 6 Google APIs which seems to have this problem. I can wait a while until Google fix that one component.Nurseryman
H
1

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.

Hurd answered 11/3, 2017 at 17:44 Comment(2)
Thanks! This is actually the only solution that worked for me on fresh 2.3 installation on Ubuntu 16.10.Entertaining
Worked for me on debian but I downloaded the tools from dl.google.com/android/repository/tools_r25.2.3-linux.zipGrecize
O
0

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"
Odie answered 11/3, 2017 at 8:25 Comment(0)
B
0

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.
Byrd answered 11/3, 2017 at 13:51 Comment(0)
E
0

I got this problem since hours on my Apple M1 processor.

After a clean delete of Android SDK, this workaround worked for me: https://mcmap.net/q/35965/-m1-macbook-pro-android-studio-installation-issue-no-sdk-being-downloaded

Just download the IDE - Intellij IDEA and create a new project, select Android Project and there download Android SDK, now you can install android studio again and the sdk is installed. Worked for me!

Encephalography answered 10/11, 2021 at 9:25 Comment(1)
This is a too big fix. I build a docker image on M1 and I can't do thatGeorganngeorge
I
-1

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.

Innumerable answered 11/3, 2017 at 14:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.