Android Studio 3.1.2 Run button enabled. But when click on run button no action happened.
I restarted android studio and my windows 10 also. But still Run button click not showing anything.
Follow the following steps:
There's a Run option on the menu, locate it and click on it.
Click on Edit Configurations
Click on Android Application on the left side and then click the + button.
Choose Android Application from the pop-up menu. Then pick the module (app). Then click apply and then Ok.
If this doesn't work, try re-importing the project into Android Studio, that should fix the problem.
I hope this helps.. Merry coding!
I guess you already solved it, but I got the same issue and found a solution. For me the problem was that adb wasn't found. After reinstalling platform-tools it got solved.
So try opening SDK Manager from Tools -> SDK Manager, go to SDK Tools tab and uncheck Android SDK Platform-Tools. After applying changes install it again.
I uninstalled android studio. Make sure that you delete every possible file, I manually deleted a few files after uninstalling android studio (yes not all files get deleted when you uninstall and specifically user settings). Then download again the .exe from their official website, it will ask you whether to import settings from the previous version, select no. And download all dependencies (make sure you have a good access to internet) and there you go!
I found the error. adb.exe was deleted from platform-tools folder and error was
"Unable to locate adb java.lang.IllegalArgumentException: Unable to
locate adb" .
Just copy paste adb.exe into platform-tools folder and run again it works perfectly..
Thanks.
if you have anti-virus try to disable it and check if adb-file.exe is deleted or quarantined by it.
in my case Avast was stopping the android studio from running
Related
I have got a problem with Android Studio IDE.
Since the last update, when I am trying to start my app in device, IDE returns an error to me ( Unable to locate ADB ).
I tried reinstall platform tools. It didn't help.
I reinstalled the Android Studio. It didn't help too.
I even reinstalled Windows, but it didn't help too.
I was looking for a solution and I tried fixing it, but it isn't working.
Please help.
1- on your android studio go to Tools > android > SDK Manager.
2- view android SDK location (this will show you your sdk path)
3- navigate to file explorer on your system, and locate the file path, this should be found something like c://Users/xxxx/AppData/local/android (you can now see the sdk.)
4- check the platform tools folder and see if you would see anything like adb.exe (it should be missing probably because it was corrupted and your antivirus or windows defender has quarantined it)
5- delete the platform tools folder
6- go back to android studio and from where you left off navigate to sdk tools (this should be right under android sdk location)
7- uncheck android sdk platform-tools and select ok. (this will uninstall the platform tools from your ide) wait till it is done and then your gradle will sync.
8- after sync is complete, go back and check the box of android sdk platform-tools (this will install a fresh one with new adb.exe) wait till it is done and sync project and then you are good to go.
I hope this saves someone some hours of pain.
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!
Possible duplicate, I just download a Android Studio Zip file like Eclipse, as I opened getting this error.
But problem is how to update it?
same problem happened to me, From this
I have faced the same issue, to solve it:
1- delete (or move) the projects folder (AndroidStudioProjects).
2- Run the Android-Studio (a WELCOME screen will started).
3- From Welcome Screen choose, "Configure -> Project Defaults -> Project Structure)
4- Under Platform Settings choose SDKs.
5- Select Android SDK -> right_click delete.
6- Right_click -> New Sdk -> Android SDK -> choose your SDK dir -> then OK.
7- Choose the Build target -> apply -> OK. enjoy
I had same issue in Android Studio 3. (the project was open) so I closed the current project and the IDE automatically prompted to download the latest components. once its done everything was working correctly.
Here's a better approach where you don't have to delete/move anything for Android Studio 3.+.
Open Android Studio and click cancel/ignore for error prompts on missing SDK for each project.
Close all your open projects. You can do this by File > Close Project.
After you do step 1 for all projects, the Welcome screen appears.
The welcome screen will detect you are missing the SDK and give you options to fix the problem, i.e., install the SDKs for you.
Click on Tools > SDK Manager or click SDK Manager
after If you are unable to see the location of your Android SDK Location, click on edit and create a folder where you want to keep it and then click Next and Finish
Source: https://stackoverflow.com/a/46351772/13093413
(Top right corner) File > Close Project > After you close the project you will get a screen which says that you don't have an sdk and will ask you if you want to install it.
I was able to trigger an SDK download like this:
Close Android Studio
Open android studio, but be ready
Once you see "loading project", click cancel. (this will only appear for seconds on a fast machine)
The SDK download window appeared!
If Android Studio directly opening your project instead of setup window, then just close the windows of all projects. Now you will able to see the startup window. If SDK is missing then it will provide option to download SDK and other required tools.
It works for me.
Create SDK folder at \Android\Sdk
Close any project which is already open in Android studio
Android Studio setup wizard will appear and perform the needed installation.
Press escape to close all errors.
close project
Android studio will prompt to install SDK
Install the SDK and configure project
1.Click on Configure
2.Then Choose Project Defaults
3.Click on Project Structure
4.Set android sdk path
You will find here "C:\User\YourPcname\AppData\Local\SDK"
Note: Sometime AppData may hidden if it will not show then enable show hidden content.
5.Apply Changes
6.Then Select Sdk From Configure option
7.Then Android sdk manager page is open
8.In bottom you will see Install packages option
9.Install them and enjoy.
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
I have installed Android SDK and it is working OK, except: for additional items,
e.g. Google USB driver
I get the error:
File not found: C:\Program Files (x86)\Android\android-sdk\temp\usb_driver_r07-windows.zip (Access is denied).
The folder ...temp is there but empty.
What is happening?
Do not use SDK Manager via Eclipse. You can find it from the Start menu and right click on it and choose "Run As Administrator".
This issue will be resolved by running your IDE (Eclipse, Android Studio) as "Run as administrator".
OR
Set your app ICON to run application always as Administrator.
Right click, select Run as Administrator. It should not cause any issue now and installation should work fine. See Issue #72982 SDK Manager cannot update when installed in C:\Program Files (x86), unless run as Administrator.
I think you must put the android SDK file in a path without spaces and because eclipse can't read the file
try it and give me your feedback....