KayFirst
KayFirst

Reputation: 473

Error about Android Studio on Macbook M1: An error occurred while trying to compute required packages

I've downloaded Android Studio from the official website, the one for M1 chip (arm).

Basically running it for the first time, the error is the following:

An error occurred while trying to compute required packages

I was searching about it the whole day to figure out a way to make Android Studio work, but that error keeps showing. Not completely sure if it's related to M1 Macbook, as on my Intel one it works as expected.

What I already tried to do:

The Android SDK location cannot be at the filesystem root

Seems like no matter what I do, it ends up showing up that same message.

When I run java -version that's what I see:

java version "1.8.0_311"
Java(TM) SE Runtime Environment (build 1.8.0_311-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.311-b11, mixed mode)

Did anyone have the same issue? Am I doing something wrong? Not sure how to proceed from here, despite of the Android Studio version I download it's always the same result.

Any help is appreciated.

Upvotes: 47

Views: 17391

Answers (9)

willnode
willnode

Reputation: 1527

My solution to this problem is simply to put the SDK in another location. For myself, I put the SDK folder to subfolders in Documents. The SDK download will initiate.

Upvotes: 1

Tuan Anh Le
Tuan Anh Le

Reputation: 11

This is what solved it for me:

  1. Download & install IntelliJ IDEA. https://www.jetbrains.com/idea/download/#section=mac
  2. Open IntelliJ IDEA and create New Android Project
  3. Download sdk success
  4. Open Android Studio & checked it worked

Upvotes: 1

Niklas
Niklas

Reputation: 25401

I've also had this exact same issue when downloading Android Studio 7.0.3. Here's what helped 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-31"
  3. Next up execute this command ./sdkmanager --channel=3 emulator (this switches the channel from stable=0 to canary=3 )
  4. Open Android Studio, and go to the SDK Manager (Appearance and Behavior > System Settings > Android SDK) Click on "Edit", and then select the sdk folder. Then "Next" > "Next" > "Finish".
  5. Now restart Android Studio and everything should work

Upvotes: 3

Raman Kumar
Raman Kumar

Reputation: 391

I had the same problem with my MacBook air(m1 chip) as you mentioned. enter image description here

How did I solve it? 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.

enter image description here

enter image description here

Upvotes: 7

keerati_ta
keerati_ta

Reputation: 101

I also faced this issue a couple days and I changed my mind to not use Android Studio. And It's fixed!

My alternative option is to download IntelliJ community edition and install Android SDK to your machine.

Image for IntelliJ Download Page

After (IntelliJ) installation is complete,

You need also to create new project, select android then download SDK. (thanks for @SteveRoger 's comment)

then open Android Studio again and follow its setup wizard. It will show that my machine has been already installed Android SDK and it can run perfectly at this time.

Hope this is an alternative solution for you. Have a great day.

Upvotes: 10

James
James

Reputation: 181

I tried over a dozen 2021 stable and Canary builds from https://developer.android.com/studio/archive and couldn't get any of them to work.

This is the only thing I could find that worked:

  1. Download, unpackage and run Android Studio 3.6.3 android-studio-ide-192.6392135-mac.zip from here.
  1. Proceed through the initial setup and let it download and install the SDK. Ignore any errors at the end.

  2. Delete this version and open the stable Android Studio like normal.

  3. You can now proceed through setup!

Upvotes: 16

Kenji Wada
Kenji Wada

Reputation: 341

I solved the problem with these steps:

  1. Install the old Android Studio 3.6.3 (find the old Android Studio at https://developer.android.com/studio/archive)
  2. Install the Android SDK
  3. Overwrite the installation with the Apple Chip version of Android Studio

Upvotes: 9

kkcodes
kkcodes

Reputation: 21

I had the exact same error as OP. Follow what Art Fedorychak mentioned, it worked for me as well. It seems like the current stable build of the Apple M1 android studio version doesn't actually initialize an SDK if one doesn't already exist, but it seems to be able to update and or / initialize one that does as long as the same folder is being referenced, so we just need to use a working SDK for M1 on the initial run and then revert back to the stable AS

Upvotes: 2

Art Fedorychak
Art Fedorychak

Reputation: 684

This is what solved it for me on my M1.

  1. Go to Android Studio Preview and download the latest Canary build for Apple chip (Chipmunk). Don't worry this is just to get through the initial setup.
  2. Unpack it, run it, let it install all the SDK components, accept licenses, etc as usual.
  3. Once it's done, simply close it and delete it.

Now when you start your stable Android Studio (Arctic Fox) you should not see the error.

Upvotes: 45

Related Questions