Android studio: Run button not working - android

When I try to run my app (my first test) for the first time, the green button shows up but the emulator does not run my app, it only works (the emulator) , and when I try again the green button( RUN) does not work.
Anyone can help ?

In my case I tapped on the "Make Project" button (the hammer icon) and then the run button worked

I know this is an old question but some other people can still have the same issue.
I was getting the same error, and a log message somewhere said me 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.

Invalidate cashe and restart worked for me

Have you made sure you unlocked the emulator? By unlock I mean like how a phone screen is locked, the emulator does the same thing.

Related

Android Studio Emulator is already running. But I can't see the emulator on the windows and run my project

Installed android studio latest update and
started a project. But when I press run, emulator is not showing up.
And it say delete *.lock files. But I have already tried. Still couldn't see
the emulator. Please help me.enter image description here
You don't have to completely delete the emulator when this happens. The files to delete should have a ".lock" extension:
You don't need to touch the configuration files.
You can easily find the files location by clicking on the arrow under the Actions tab (in the ADB manager), and selecting "Show on Disk".
On the AVD (Android Virtual Device), edit the device graphic setting from Automatic or Hardware to Software
Go to the down arrow and click on the "Show on Disk" link like the attached image. You will get the list of all files, remove the file "hardware-qemu.ini.lock" and start again.
Try to delete All the .lock files under .android/AVD/emulator_name/.lock,
And right click the emulator wipe data,restart/rerun the emulator.
It's restart the Avd and rebuild the gradle projects.
You can open the task manager and see if there are "qemu-system-x86-64.exe", "adb.exe" and "emulator64-crash-service.exe" processes among the processes, and then you can kill these processes. so you can restart your emulator.
Thank you all for the answers. After trying many ways of your suggestion, I finally decided to uninstall this version and reinstalled the previous archive and it now working fine. I still don't know the reason why. Thanks
Follow this https://stackoverflow.com/a/73287406/11139649 and then delete the Virtual device and create a new device.

"The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22"

I'm Windows 7 64-bit user and I got Android Studio problem after I update the latest version of Android Studio and SDK components..
The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22
Please help me to resolve this problem. Thank you.
I had the same issue when trying to upgrade Android Studio from 1.1 to 1.2 on Mac OS 10.10.
I solved the problem by selecting custom installation instead of standard. Also we need to select the Android SDK Platform (Lollipop 5.1).
Choose the new UI Design >> next
Just try to cancel the "Downloading Components" from upper right
corner 'X' button.
A dialog box will appear then click OK (wait a bit for first time
launch)
I uninstall Only Android studio (keep the SDK and Emulator) and then reinstall it just android studio. took me 2 minutes and my android studio work again.
I had this same problem, but I'm a Linux user.
I resolved the problem by reattempting the installation with adminstrator privileges. [For those Linux users reading this, I ran studio.sh with sudo.]
I just click 'Retry' and it's ok! Also run on Win7 64-bit.
TRY BELOW SOLUTIONS.
SOLUTION 1:
-> Run Android Studio as Administrator (this is only required for first run or when any issues arise due to automatic updates on any run in future).
Though it shows API 23 is or any other updates are not installed (and wouldn't show any 'Retry' button), BUT still the download and installation of rest of the updates would proceed (you can see the download progress incrementing even after seeing the above errors). So, DO NOT ABORT the operation.
-> At the end of installation (after rest of successful updates are installed) it would this time display the "Retry" button to retry installation for API 23 or any other versions which had failed earlier. Then click the "Retry" button, it would work this time.
This would resolve your issue with successful installation.
-> Next time onward no need to run Android studio as Administrator, unless it does any automatic updates and shows similar issues.
SOLUTION 2:
-> Alternative approach is to install any updates (which ever failed in earlier attempt) from Android SDK Manager first and then later launch Android Studio (which would not need any check for updates and any additional installations).
To install any features or updates, run Android SDK manager as administrator (run as administrator is not mandatory for this but preferred to avoid any permissions related issues) and check the required options and proceed with the installation without any issues.
SOLUTION 3:
-> If still your issue is not resolved, then try the proxy solution as suggested by others or check your internet connectivity if it's working properly or not.
*Any of the above solutions should resolve your issues.
go to c->users->[Your user account]-> remove android 1.2 and restart the android studio
when it ask to import select first radio button which is import setting from previous config
there you go fixed
I am using Windows 7 Professional and I was having same problem #Bayu Mohammad Lufty not worked for me.
I simply delete .AndroidStudio1.2 from my C:\Users\UserName\ and restart my Android studio again.
It open Android Studio perfectly!
It configured everything again in next start :)
I'm a MacOS user.
I solved it by uninstalling Android Studio and reinstalling it again.
If you want to try this link helped me a lot.
Uninstall Android Studio MacOS (terminal)
When you are installing Android Studio, under Install type do not use standard setting, use custom setting instead, and check all the option boxes in the next step.
i have solve my same problem
i update my android studio, and i choose not to import my setting from my previous version than that problem appear.
than i realize that i have 2 AndroidStudio folder on my windows account (.AndroidStudio and .AndroidStudio1.2) and on my new .AndroidStudio1.2 folder there are no other.xml file.
than i copy other.xml file from C:\Users\my windows account name.AndroidStudio\config\options to C:\Users\my windows account name.AndroidStudio1.2\config\options
and that how i solve my problem.
I'm using UBUNTU and I got this same error. I restarted the set up using sudo and did a custom install. This solved my problem!
--More Specific--
re-installed using # sudo ./studio.sh
then I made sure to click "Custom Install"
then I made sure all packages were selected.
And I got this message Android virtual device Nexus_5_API_22_x86 was successfully created
I just run:
C:\Users[Username]\AppData\Local\Android\sdk\SDK Manager.exe
Install SDK Platform Android M Preview
And run Android Studio again.
It's working for me :D
When this error occured I first clicked retry for few times and waited for 2 minutes and clicked 'retry' then it installed without any error.(for 2 minutes I was searching to solve this problem online).
I was getting an "out of space" error, which left me scratching my head as I had plenty of disk space, until I realized that it ran out of space on /tmp, which on Arch Linux is mounted on a tmpfs with a size limit.

Why Android ddms not showing emulator or connected devices?

This is a screenshot of my DDMS. As you can see there is nothing and I cant find any way to get the devices list or any other functional parts.
I try to reinstall android studio and new sdk but still its not solved. Is there any way to solve this problem?
Thanks
I encountered this problem this afternoon, after half day of annoying work, I solved it at last.
The solution is, just delete *.cfg and monitor-workspace in $HOME/.android/.
Below is how I solved the problem.
There's little information about this problem. I guess it is a rare one.
I have tried several ways. First, reinstall the build tools, simply download and replace the tools directory. But it didn't work. And then I reinstalled the Android Studio, still not work either.
But during the procedure I have found that the ddms must have saved some cache in the computer. So I find the place $HOME/.android/ in this website.
After delete all *.cfg(3 or 4) and monitor-workspace, my ddms works well again.
I guess delete all *.cfg is not necessary, just ddms.cfg. But I'm not sure.
Go to DDMS perspective -> Devices -> View menu(on right corner) -> Reset adb
If still not working, run this commands in command prompt/terminal
adb kill-server
adb start-server
It was broken after latest Android SDK sync using Android Studio. To fix it, launched SDK manager using Eclipse, and installed SDK tools versions 24.01 and 19.1, and removed intermediate results.
I had to right click on "DDMS" (perspective button) and click on reset to make it work.
I am not sure, but you can try Window menu => show preview (select your necessary window view ).
and another try minimum /Maximum window button press
Thanks
Delete the .android directory in user home

AVD manager won't start anylonger in Eclipse

When I press the AVD Manager button in Eclipse, nothing happens (and I mean nothing) ...
When I try to run an app, I get the message "No compatible targets were found. Do you wish to add a new Android Virtual Device? When I click "Yes", I get the "Android Device Chooser" Window. This is completely empty (no devises listed). So I check the radio button "launch new Android Virtual Device", which activates the "Manager" button. But when I click this button, again nothing happens ...
So, for some reason my AVD Manager won't start up.
PS: The AVD Manager did work before, when I was going through the "Hello World" exercise. For some reason it stopped working. I tried reinstalling the whole SDK and Eclipse thing, to no avail. I work with Windows 7.
Any suggestions?
i had the same problem. so i uninstalled the sdk (C:\Program Files (x86)\Android\android-sdk) and deleted the C:\Users\hp.android folder (make sure to delete this folder else the problem will exist even after reinstallation). upon reinstallation everything worked perfectly...
Try to install or reinstall the AVD system image in Android SDK Manager in Eclipse.
You might have not set the sdk path. to do so,
step1: go to windows menu option
step2: click on preference,
step3: select android
step 4: change the android sdk path and restart eclipse

Why every time after running application new android emulator is started and none of them are shown in DDMS section

First my emulator is too slow to work properly. I'm already frustrated because of it. So I closed that emulator and stated another(by running the application). But now my emulator is not showing in DDMS and every-time I run the application it creates new emulator rather than using existing. So I'm not able to run the application on emulator. If I connect a device then the device is showing in DDMS and working properly, but not my emulator.
And please don't tell me to restart emulator, eclipse etc. Because, already a lot of times I have tried it(even restarting PC), but its useless.
Try running the emulator via the command line with the parameter -verbose, might give you some information on the issue.
I solved this issue by going to wards DDMS-> reset adb..
I understand that the emulator speed is too slow. If You want to start the same emulator, You may choose it explicitly.
If you are using eclipse Right click your project -> Properties-> Run Debug Settings -> Click on your project name -> Edit -> and choose 'Always prompt to pick device' .
So now everytime you build your project, you can choose the same emulator.
Hope this helps!!!
I solved this issue by removing the path to platform-tools from my bashrc file.
In Mac OSx, you need to go Run-> Edit Configuration and you need to tick use the same devices for future

Categories

Resources