Related
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:
Installing the command line tools, then placing it on SDK folder (Users/user/Library/Android/sdk). Then added the bin to the PATH (Reference)
After doing that, when executing the sdkmanager on terminal I get the following message Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
Then I searched again and it leaded me to this thread, then as on the answers I tried to rename the folder, then other tries not related. I fell into many links and references that did not work at all.
After that I try to check what happens if I click on New Project, then the following is shown:
The Android SDK location cannot be at the filesystem root
As the message indicates, the issue is The Android SDK location cannot be at the filesystem root, so I searched again about it
I looked into that and got to a few links, for example this one and this one. Before doing that search I clicked on the Edit button, which lead me to the Android SDK to be updated/installed (Nice!), so I had to delete the content I had on Android folder (inside Library) and clicked next...then, I got the same message An error occurred while trying to compute required packages.
Then I thought "ok, maybe if I change the SDK location", so I changed to ../Documents/sdk, which ended up in the same result
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.
This is what solved it for me on my M1.
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.
Unpack it, run it, let it install all the SDK components, accept licenses, etc as usual.
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.
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:
Download, unpackage and run Android Studio 3.6.3 android-studio-ide-192.6392135-mac.zip from here.
Proceed through the initial setup and let it download and install the SDK. Ignore any errors at the end.
Delete this version and open the stable Android Studio like normal.
You can now proceed through setup!
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.
I solved the problem with these steps:
Install the old Android Studio 3.6.3 (find the old Android Studio at https://developer.android.com/studio/archive)
Install the Android SDK
Overwrite the installation with the Apple Chip version of Android Studio
I had the same problem with my MacBook air(m1 chip) as you mentioned.
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.
I've also had this exact same issue when downloading Android Studio 7.0.3. Here's what helped me.
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.
Install the latest platform: in a terminal, execute ./sdkmanager "platforms;android-31"
Next up execute this command ./sdkmanager --channel=3 emulator (this switches the channel from stable=0 to canary=3 )
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".
Now restart Android Studio and everything should work
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
This is what solved it for me:
Download & install IntelliJ IDEA. https://www.jetbrains.com/idea/download/#section=mac
Open IntelliJ IDEA and create New Android Project
Download sdk success
Open Android Studio & checked it worked
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.
After installing the Android studio and launching it I am getting this error.
I cannot specify the path to the SDK. I have tried giving the path as :C:\Development\Android\android-sdk-windows\platform-tools\" but the path is invalid
Try this:
close this box then
Tools -> Android -> SDK Manager
I encountered this problem when installing Android Studio 3.0.
There was in fact no folder named C:\Users\Your Name\AppData\Local\Android\Sdk after I installed Android Studio. I tried installing the Android command line tools at this location, but android studio did not accept this. (Turns out, the command line tools are not the SDK.)
Managed to fix it by doing a complete uninstall of Android Studio, deleting the C:\Users\Your Name\AppData\Local\Android folder, deleting any Android Studio settings folders (in my case C:\Users\Your Name\.AndroidStudio2.3 and C:\Users\Your Name\.AndroidStudio2.3). After reinstalling and opening Android Studio, it gave me a dialog to download the SDK.
I can think of 2 possible explanations why this worked for me:
Originally, Android Studio was opening a project straight away, which didn't trigger the "download your sdk" dialog. (This no longer occurred since I deleted my Android Studio settings.)
There was some kind of setting that made Android Studio think I already had the SDK downloaded.
Try this - C:\Users\Your Name\AppData\Local\Android\Sdk
Replace Your Name with the name of your PC.
This problem is usual after you update, or reinstall the Android Studio.. Follow these steps-
* Close all the opened project which is opened by default after you started the Android Studio.. and again open the Android Studio, it will direct you towards re-downloading of SDK components from the net (So be sure to have net connectivity at this point)..
* If above step doesn't work, then restart the PC and open Android Studio again..
Hope it will help..
C:\Program Files (x86)\Android\android-sdk
Hope this will work.
I was also stuck with this...i tried everything mentioned above, but could not get through.
Then I was about to uninstall and reinstall the IDE as mentioned above.
When I was about to uninstall, to my surprise, I found Android SDK Tools in control Panel -> Programs and Features, which was the thing I was looking for!
Android SDK Tools in Control Panel -> Programs and features
I didn't know how to find the path of that, because even after searching in my computer, I didn't get it. So, I went on further and clicked on uninstall.
There, I found the path of Android SDK Tools "C:\Program Files (x86)\Android\android-sdk\". I did not uninstall anything.
I linked this path in the dialogue box, the error was gone!
Whoever encounters the same error, should look for the "Android SDK Tools" in the programs and features in control panel, and then go for uninstalling the same.
There you will find the path of the tools folder.
Copy and paste that path, and you shall get through.
When installing Android Studio on my Mac I accidentally cancelled the dialog box that would normally have installed the SDK. To fix this I deleted Android Studio from /Applications, and deleted the following folders:
% cd $HOME
% rm -rf Preferences/AndroidStudio3.4
% rm -rf Logs/AndroidStudio3.4
% rm -rf Caches/AndroidStudio3.4
% rm -rf Application\ Support/AndroidStudio3.4
(Adjust the version number for your version.) I then reinstalled Android Studio and let it guide me through the SDK installation process.
In case anyone get to experience the same weird situation as me:
I had installed Android Studio, had projects saved, but for some reason I had to do reinstall Windows (and during that I deleted my "Android-folder" in ".../local". When you do that, you will encounter the exact same pop up.
No worries, close it and even though it says that it is needed, it's not. You just don't have access to the prior projects. When saving the new one, then everything will be OK.
The problem was solved by downloading the SDK again, in my case I had deleted the SDK folder that was in C:\Users\george\AppData\Local\Android\Sdk, because I deleted it then I had to download the SDK
I just reinstalled Android Studio (everything) C:/user/yourName/.androidStudio.4 and C:/user/yourName/.androidStudio.4.
You dont have to delete your projects folder!
In my case, going to the Settings menu in Android Studio, there I could download the SDK (none were installed) through the "edit" button
I got this error when moving a project from one computer to antother, even though it wasn't an Android project and didn't need an Android SDK.
The solution for me was to open the file local.properties and remove the line that says sdk.dir. Hope this can help someone.
All you need to do is close the project opened in android studio. This error occurs when you reinstall Android Studio. The previous project that you have been working on will be opened by default. Select that folder from file explorer and move into different location and then again launch Android Studio. The SDK installation will begin thereafter.
The Reason that why Android Studio can't install/find SDK automatically:
As I tried many times for reinstalling Android Studio, but each time I faced with this SDK popup. I figured out that after installing, Android Studio seeks for project folder automatically (usually located in C:\Users\Username\AppData\AndroidStudioProject) to syn previous settings, gradle, SDK path, Android Studio Settings etc. When I deleted this folder (if you need your previous projects copy it somewhere for latter replacement) the usual installation has been started after clicking on install.
I just encountered this issue when updating my Android Studio after a couple of years of not using it, and the solution ended up very easy:
I exited the window with the SDK prompt and closed the old project it was trying to open. Once the project was closed, the IDE was able to prompt me with the download window, and there SDK download worked!
when i click to install android platform tools it shows following image
when i click exit studio and launch sdk manager android studio is closing but sdk manager is not launching
If i try to attempt all packages the following image is occuring
please help me to fix this issue
Yah thats correct it will take time download and unzip all the downloaded files and then it installs on your system till that time you have to wait
From installed Sdk Path(ex c:\sdk\ etc) -> launch SDK manager, try right clicking on the SDK Manager.exe and selecting "Run As Administrator". close all the instances of android studio before updating.and kill adb.exe also.
Also, some anti-virus programs have been known to interfere with SDK Manager
SDK path
If you're using android studio then...
Open the Android SDK Manager.
At the top of the window, just above the list of SDKs, it says "SDK Path: ".
mine is:
C:\Users\[account]\AppData\Local\Android\sdk
You can try to launch Android SDK manager manually by launching SDK manager.exe . You can find its location in windows by Android studio. Go to Menu option
File-> Project Structure->SDK location
If it give you any error on launching as per https://stackoverflow.com/a/39097281/4290570 , please feel free to comment further.
When I try to open up the SDK Manager in eclipse it says opening shortly, but never opens. I've tried to open the exe file but it displays an error message saying:
Failed to execute tools\android:bat the system cannot find the file specified
My path environment variable leads it to the tools folder.
This is the path:
C:\Users\Shan\Documents\Computer Science - YEAR 2\Android App Development\adt-bundle-windows-x86-20130917\sdk\tools
In my case the Tools directory just disappear.
..\sdk\tools
To solve it:
1) Just go to SDK zip -> adt-bundle-windows-x86_64-20131030.zip
2) Unzip the Tools Directory only.
3) copy it under ../sdk/
I had a similar problem today. Press the Windows button and Search for android.bat(in the search programs and files text field)
Then copy the file to your android SDK folder (C:\Users\Shan\Documents\Computer Science - YEAR 2\Android App Development\adt-bundle-windows-x86-20130917\sdk\tools\).
After that don't run SDK manager but run the android.bat file.
Hope this helps
-Zaniar
I had to move the AVD manager from /sdk/tools/lib to the root folder /sdk
Copy the AVD Manager.exe and SDK Manager.exe from
SDK_ROOT_FOLDER/tools/lib/
into
SDK_ROOT_FOLDER
I've been working with this problem for three days and finally was able to run SDK Manager by
==> Running the android.bat file as administrator
Note: I did not have to make any changes to the .bat file (such as setting the java_exe path) in order for the manager to run.
I saw this as a comment on the top answer but can't upvote yet, so confirming it here!
I cancelled an update to Android Tools and it seems there's a bug with unzipping the old (or new?) version back into {android_sdk}/tools. The zip is located in {android_sdk}/temp. Just unzip it into the right location and it should work again.
If the accepted answer doesn't help anyone, it also might be a permission issue (if the SDK is installed in Program Files (x86), for example, so try running android.bat as Administrator,
I had the same issue when updating the Android SDK Tools and SDK Platform-tools from the SDK Manager. I had to replace the tools folder with one located in a zip folder inside the temp folder.
In My case, While I installed visual studio 2015, The SDK files were missed and I am getting an error window shown below.
So I manually downloaded the tools from the following URL.
tools_r24.0.2-windows
Then extract the zip file and copy the tools folder in the following location.
C:\Program Files (x86)\Android\android-sdk
It worked for me.
I think current Android SDK only works with JDK x86 version. I search so much but when installed JDK x86 version Android SDK manager worked without problem.
Copy your android.bat file to C:\adt-bundle-windows-x86_64-20140702\sdk\tools folder or copy all files to C:\.
If you are seeing this error, it may be an issue with your COMSPEC environment variable.
Please see https://stackoverflow.com/a/27284746/3866013 for more details.
I had the same problem. Caused it myself because while runing Android SDK Manager i hit UNINSTALL SDK Tools.
I fixed the issue by running the installation of the Android SDK again. The installation folder had to be the same as previously. After the installation, everything was back again as it was.
This is how I solved the problem on Windows 7:
I was going to update the SDK using Android SDK Manager but android.bat was not found because previously it uninstall the older one and then installs new. In my case my SDK Update was interrupted i.e. in other words, could not install after the SDK Manager uninstalled the tools, so my machine was not able to find android.bat. What I did was just downloaded the standalone SDK tools to the same folder where my SDK were from :
http://developer.android.com/sdk/index.html#Other
https://developer.android.com/sdk/index.html#Other
Here are two options for downloading the Android SDK for Windows users. One in recommended option and the other is .zip file. Zip file worked well.
Another option may also work. Try searching android.bat with windows search engine. If you find the one, copy it and paste in SDK tools folder.
open Sdk Manager.exe, then i deleted first Android Sdk tools, so, I also appeared such a mistake, then I downloaded installer_r24.3.2-windows.exe, installing, copy C:\Users\Super Man\AppData\Local\Android\android-sdk\tools folder to my Sdk path,run My Sdk Path\android.bat ,ok!!
I did the following :
I created a folder SDK right below my C-drive
I unzipped tools_r25.2.3-windows.zip to C:\SDK
I moved SDK Manager.exe from C:\SDK\tools\lib to C:\SDK
I first ran SDK Manager.exe in 'normal mode',but this gave me the error, but when I ran SDK Manager.exe as ADMINISTRATOR it didn't return the error.
The reg command exists but for unknown reason my path variable was corrupted during some installation.
So some basic element were missing:
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem
I am an android programmer, i use eclipse. i want to try android studio, thus, i download it and tried to open it.
it says that i have to put the sdk path.
what i have tried
i tried to set it to my the android-sdk which eclipse is working on it. that sdk is up to date and have all the supports, apis ...etc.
also
i found a question here in the stackoverflow about my problem: Android-studio Selected directory is not valid home for Android SDK
The solution was to open the android studio and then press f4 and then go to platform setting and the press the plus green sign then select the sdk then select the path to my android-sdk, i did all of that but android studio keeps telling me that the
The selected directory is not a valid home for Android SDK
any help would be appreciated
I found the solution myself, the answer was to run android studio as an administrator :P
Had the same problem.
I was trying to select
C:\Program Files (x86)\Android\android-sdk\platforms\android-XX
But what I actually had to do was to select android-sdk folder.
C:\Program Files (x86)\Android\android-sdk
Then I was able to choose the API I wanted from a list of APIs that would show up.
I had this problem, select SDK folder (NOT SDK->sources or SDK-platforms)
I found another solution make sure that you have write access to that directory. That fixed the issue for me.
Another way this may need to be fixed is by making sure there is at least one SDK
platform installed. Run in the commandline from the android-sdk folder:
.\tools\bin\sdkmanager.bat platforms;android-XX
where XX is the any Android SDK version.
It might occurs, if Android Studio tries to open the previous project with ".idea" directory. Well, solution is to remove that folder and .iml file too.
Works for me.
What helped for me was moving the android sdk to a folder without any special characters (e.g. no "Program Files (x86)").
In intellij idea File -> Invalidate Caches/Restart
I solved it from here
http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/
1- Just close current error window and let run the android studio
2- open sdk manager as shown in below
3- Clik on Edit sdk location as below
4- Simply press next button if there is correct location for sdk you want to install there
5- let it be downloaded
6- install platform and SDK tools and
7- Enjoy
For me the problem was I copied the previous Android Studio settings from my old computer, and then I imported them. But I didn't copy the old SDK! Probably the SDK path is also configured somewhere in the old settings. Instead of download them, Android Studio kept complaining about my SDK location. Finally, I also just copied the old SDK directory and then the problem was solved.
Problem Statement selected directory is not a valid home for sdk
I have resolved from here
http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/
1- Just close current error window and let run the android studio 2- open sdk manager as shown in below
3- Clik on Edit sdk location as below
4- Simply press next button if there is correct location for sdk you want to install there
5- let it be downloaded
6- install platform and SDK tools and
7- Enjoy