AVD emulator launches but does not load new application - android

I'm developing my android app in Eclipse. I used to debug my android app with the AVD emulator and a real phone device as well. Lately I face the following problems when I try to work with the emulator:
When I issue "Run As" or "Debug As" Android Application, the AVD emulator launches but it does not load the latest version of the application. It keeps a previous version of it. The DDMS does not load the "Emulator device" in the Devices tab. Moreover, the Debug "Logcat" does not write anything.
When I work with the phone device everything is working properly. Any suggestions?
Some more info that may help:
From the Manifest file:
From the default.properties file: target=Google Inc.:Google APIs:12
AVD Emulator targe: Android 3.1 Google APIs Level 12

If your emulator properties have Snapshot option enabled, then uncheck it and rebuild your application after cleaning it. The emulator might be picking your old copy from snapshot.

in your emulator snapshot should be disabled as well as in "DEV Setting" option USB Debugging mode should be enabled . it will work fine

Related

Android Emulator not working on M1 Chip Mac

Installed Android Studio. Created a device. Did a "Cold Boot Now" and it just sits there and never connects.
I get the message "Connecting to the Emulator" and that's it.
Connecting to the Emulator Screenshot
Some people have had issues like this with the embedded, tool window emulator. You can launch the emulator as a separate process by going to Android Studio preferences, Tools -> Emulator and unchecking "Launch in a tool window".
Update: The issue is fixed in emulator 31.2.7 now available in the stable channel.
You can try to use images from the Other images tab. You can see this tab while creating new AVD after choosing device.

Time out waiting for emulator to come online in android studio

I am new in android and trying to run a simple Hello world! program using android studio. I defined an AVD which is a Pixel device with API version 28 (Pie). When I run the program, the emulator gets up, but it doesn't load the application. I have tried following, but none of them worked:
Restarting avd server from command-line.
Changing skin to QVGA.
Creating a new emulator.
Setting graphics to software.
Any idea on the issue?
I think you do not enabled USB Debugging in your AVD.
Try this steps:
1- go to your AVD setting
2- System
3- About Device
4- Multiple Clicks on Build Number
5- Go back to setting
now you see Developer Options
6- goto developer options
7- check USB Debugging
Hope to be useful
Have you enabled USB debugging inside the emulator?
Before you create an Android emulator, you need to install an Android system image that your emulators can use.
Note: If you installed the Android SDK and NDK during RAD Studio installation, a valid Android system image (such as Android 4.2.2 API 17) should already be shown as Installed in the Android SDK Manager. In this case, you do not need to install another Android system image.
Still, if you are not able to run the emulator then try this Memu Emulator
This is a very small and simple emulator to use and install. It works perfectly on every pc.

Xamarin.Android Projects failed to deploy in visual studio emulator for android

I'm using visual studio 2015 update 1 with windows 10 build 10586 TH1.
also I'm using Xamarin Version 4.0.1.96.
I have created a blank Xamarin.Forms app. It deploys to Windows Phone emulators without any issue. But unable to deploy to Android Emulators.
When I start android project Android Emulator launched successfully but visual studio freeze at this step.
I've tried a lot of android emulator profiles but cannot solve the problem.
This problem only exists for Emulators and project successfully deployed on physical android device.
I have the same issue with Xamarin.Android projects.
Here is all of the text in output window:
1>Starting deploy 4.5" KitKat (4.4) HDPI Phone ...
1>Starting emulator 4.5" KitKat (4.4) HDPI Phone ...
1>Validating emulator arguments...
1>Determining if emulator is already running...
1>Preparing virtual machine...
1>Launching emulator...
1>Emulator launched successfully
Thank you in advance for your help.
I was running into the same issue with the emulator starting up find but Visual Studio getting hung on the build/deploy. Finally figured it out from here.
Visual Studio gets stuck trying to deploy the app to the emulator or the emulator does not appear as a debug target in other IDEs
If the emulator is running, but it does not appear to be connected to
ADB (Android Debug Bridge) or it does not appear in Android tools that
make use of ADB (for example, Android Studio or Eclipse), you may need
to adjust where the emulator looks for ADB. The emulator uses a
registry key to identify the base location of your Android SDK, and
looks for the \platform-tools\adb.exe file under that directory. To
modify the Android SDK path used by the emulator:
Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.
Modify the Path registry variable to match the path to your Android SDK. Restart the emulator and you should now be able to see the
emulator connected to ADB and associated Android tools.
The value in my registry was set to "C:\Program Files (x86)\Android\android_sdk" (or similar). Updating it to "C:\Users\{USERNAME}\AppData\Local\Xamarin\MonoForAndroid\AndroidSDK" solved it for me. (I haven't yet worried about how to make this work for all users.)
I had the same issue but in my case it was not the registry. After doing a release build, I deployed the app to the emulator device in release mode which pushes the app to the device and then effectively "disconnects". These leaves a version of the app on the device which seems to block further attempts at debugging.
I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.
I had the same issue. After a long struggle i fixed it.
Sol 1 :
Check with the registry as mentioned by others.
**HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools**
Sol 2 :
In my case there is no android-SDK tool found in registry. So you have to add the registry manually here "**HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node**"
you can add it by right click on **Wow6432Node** => **New** => **key**.
Set Key name as **"Android SDK Tools"**then right click on **Android SDK Tools** =>**New** => **String Value**
Set Name as **Path** for newly added string. Then right click on **Path** => **Modify..**
Copy the Android SDK Tools path from program files and paste in Value Data.
Now the registry is created manually. You can debug the project via emulator.
Note : Don't forgot to restart the system.
Have a look here:
Xamarin Forms Android App Crashes Running Debug with VS Android Emulator
Start the Hyper-V manager
Select the emulator you are trying to use
Right-click, hit settings
Click processor
Click Compatibility
Set checkbox “Migrate to a physical computer with a different processor version”
You do not have this issue on a laptop because its processor does not provide the new features which are unsupported by the Android Emulator for Visual Studio. The described tweak is only needed on PCs with newer CPUs.
I got round this problem by starting Visual Studio as an administrator.
I too have had weirdness with the Visual Studio Emulator for Android and visual studio appearing to be stuck at the "Deploying ..." step trying to launch the app for debugging.
What I discovered is that restarting both the emulator and visual studio seems to make things better for me once it starts to do this.
Also, when debugging an app, it seems that exiting your app normally helps compared to when using the "Stop Debugging" button.
For example, I started my app twice and killed it w/ the "Stop Debugging" button, but couldn't deploy/start the app a 3rd time w/out a restart of visual studio and the emulator.
Am using VS 2015 Community edition w/ update 3.
I just had a very interesting experience,
In my case the registry path to SDK was correct,
I had unchecked the "Use Fast Deployment" (under packaging properties in android options), and
all my efforts to reboot the PC, close VS, Close Emulator start over had failed.
However I did these two:
1 - Updated all the components in android SDK manager and restarted the PC,
2 - Disabled my anti-virus! and then suddenly VS deployed the app to the emulator!! (It was stuck in the same situation where the emulator starts and nothing happens!, I did this out of despair!)
(OS: win 7, professional, VS 2017 Community edition!)
More Details
I have been trying this for three more days
For my special case disabling the Anti Virus seems to solve the issue every single time!
The solution for me was to Check the deploy box in the Configuration Manager
This answer came from Xamarin Forum

Android studio: emulator is running but not showing up in Run App "choose a running device"

I have launched my emulator via the AVD manager and once it's running I have clicked on run app. I have waited a couple of minutes for my running device to show up in choose a running device but the window always stays blank.
Probably the project you are running is not compatible (API version/Hardware requirements) with the emulator settings. Check in your build.gradle file if the targetSDK and minimumSdk version is lower or equal to the sdk version of your Emulator.
You should also uncheck Tools > Android > Enable ADB Integration
If your case is different then restart your Android Studio and run the emulator again.
This thread helped me to solve my problem, in particular this answer:
In Android Studio go to Menu -> Tools
Android
Uncheck Enable ADB Integration
Had similar issue with my emulator.
Solved by Wiping Data of emulator
Tool > ABD Manager > Down arrow under Action Wipe Data
Note : This is remove all data inside emulator.
For anyone else having the issue - none of the answers provided worked for me.
My case may be different to others but I had Android Studio installed first which installs the SDK by default to: C:\Users\[user]\AppData\Local\Android\sdk. We then decided to use Xamarin for our projects, so Xamarin was installed and installed an additional SDK by default, located here: C:\Program Files (x86)\Android\android-sdk.
Changing Xamarin to match the same SDK path worked for me which I did in the registry (although through the VS settings I'd guess it's the same):
\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools\Path
Change the path to match the Android Studio SDK path, close everything, start the VS Emulator, run Android Studio, ensure ADB integration is off and try. It worked for me.
If you uncheck the ADB Integration, you cannot use the debug any more.You may just restart the adb server, run
$adb kill-server
$adb start-server
in Terminal to restart the adb server without restarting the Android Studio. Then the emulator shows up.
My emulator used to suddenly disappear but the app still continues to run.
Solution-
Open task manager and kill qemu-system (Under Android Studio). This will stop the emulator. Then restart emulator.
Your adb connection is broken.
close eclipse
open cmd-prompt type adb kill-server then adb start-server
reopen eclipse
run the project!
Wipe the data of your Android virtual Device and then start the emulator. Works for me.
I had the same issue on a brand new computer, and the reason was simple. Although I downloaded and unzipped the Android SDK, I didn't add it to the PATH. So:
On Windows, you have to launch envvar and there, add the path to your android/platform-tools
On MacOS, edit the .zshrc file in your home, and add
export PATH="$PATH:/your/own/path/to/android/platform-tools"
This answer is not proposing a solution. Just a workaround in case someone is looking
I am using Idea based Android Studio (some people are talking about eclipse one here)
When I launch the app in the emulator (using the Run App button of Android Studio) AVD shows up but the app does not launch or run.
However when I connect my mobile and launch the app on my mobile the App works (this itself took some time, enabling developer options on mobile and doing the right configuration)
Because My app is launching on connected mobile, I can say nothing wrong with App.
There is some problem with AVD integration which I could not figure out so As of now I am working around my problem following way.
1 - I installed the app manually by dragging the APK file on AVD. (APK file is app\build\outputs\apk\debug folder)
2 - Then my AVD was not showing the installed APP list.
3 - I searched my APP using Google bar on AVD and dragged the APP icon on the home screen of AVD.
4 - I can now launch the APP using my APP icon on the home screen of AVD.
**That's how I am working around my problem. **
I have verified that Run App Icon does install the Application. Installation, not launching, appears to be the problem for me.
try to open the emulator and run it parallel with android studio/eclipse and the option will be displayed to select in the choose the device(emuator name, mine is Genymotion).
Check the android path of the emulator.
I had to change the registry in here:
HKEY_LOCAL_MACHINE > SOFTWARE > WOW6432Node > Android SDK Tools
to the actual path of the sdk location (which can be found in android studio: settings-> System Settings -> Android SDK)
All the credit goes to the author of this blogpost www.clearlyagileinc.com/
start device from genymotion button (have to install genymotion before and setup genymotion folder location on settings)
run application
choose genymotion running device
in your device you want to run app on
Go to settings
About device >> Build number triple clicks or more
and back to settings you will found "Developer options" appear
go to and click on "USB debugging"
Done

switching SDK in eclipse

I have installed the SDKs(1.5,1.6,2.1,2.2) from AVD manager, and created a new emulator device with version 1.5. However, I cannot find this device in run configuration target. It only displays the devices created with version 2.2.
What's the minimumSdkVersion/targetSdkVersion version in your XML ?
It looks like this is a bug. "Run Configurations"/"Debug Configurations" filter out all emulators that have API Level lower than what is specified in target property in default.properties file of Android project.
There is one workaround.
In your "Run Configurations"/"Debug Configurations" select your configuration, go to "Target" tab and click on "Manual" radio button. This will show you list of running emulators when you want to start/debug you app.
Start Android 1.5 emulator manually (from AVD Manager), wait until eclipse sees this emulator as "online" in "Devices" view.
Start you application and select the Android 1.5 emulator to run on.

Categories

Resources