2

I have followed the instructions on the official site.

But I am unable to install Android Studio. I'm getting error message "An error occurred while trying to compute required packages" as shown in the attached image.

enter image description here

Few months back when I tried to install Android Studio there are instruction in Android Studio official webpage to install Java JDK. Today I don't find any traces about it. Do I need to install any Java related file to fix the error?

rjdkolb
  • 10,377
  • 11
  • 69
  • 89
  • 1
    Possible duplicate of [dependant package with key emulator not found while updating android SDK and tools](http://stackoverflow.com/questions/42732684/dependant-package-with-key-emulator-not-found-while-updating-android-sdk-and-too) – OneCricketeer Mar 11 '17 at 23:23

1 Answers1

1

Of course you need to install the Java Development Kit.

sudo apt-get install openjdk-8-jdk

... e.g. in the terminal should do the trick.

EDIT:

There's a manual workaround!

As per post https://stackoverflow.com/a/42733510/7694425 :

  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".

Still, it doesn't resolve the missing emulator package therefore the Android SDK tools can't be updated since it's a dependency. But Android studio works and you can download other packages.

Looking forward to a better solution.

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!

Community
  • 1
  • 1
PeterPan
  • 684
  • 1
  • 10
  • 27
  • Didn't worked. First I tried the above command you shared. I got error. Then i tried below command and installed jdk 9 and after your edit I installed jdk 8. sudo apt-get -o Dpkg::Options::="--force-overwrite" install openjdk-9-jdk But the problem not solved. – Laxmi Chaitanya Kumar K. Mar 11 '17 at 23:09
  • Look at the post again. – PeterPan Mar 11 '17 at 23:21