Eclipse Failed to start Android app in Emulator - android

I get the following output on Eclipse Console (Started with UAC on Win 7):
(Nothing on LogCAT)
[2011-07-01 18:13:42 - Test_Android_2_2] ------------------------------
[2011-07-01 18:13:42 - Test_Android_2_2] Android Launch!
[2011-07-01 18:13:42 - Test_Android_2_2] adb is running normally.
[2011-07-01 18:13:42 - Test_Android_2_2] Performing nx.Android.Test_Android_2_2Activity activity launch
[2011-07-01 18:13:44 - Test_Android_2_2] Launching a new emulator with Virtual Device 'Test_AVD'
But still there is no trace of my application on the emulator. It just shows the regular menu items & API Demos & other stuff.
Am I missing something?
P.S.
-adb kill-server & adb start-server did not help.
-Launching SDK, adb & Emulator before Eclipse does not help. While launching the app Eclipse doesn't see the any Currently Running Emulators so I'm forced to start a new one.
Thanks,
Nisheeth Barthwal

Strange as it may be. I went to LogCat console and noticed it had nothing. While people all over the net said to look for LogCat log.
That led me to thinking that maybe Eclipse wasn't able to talk to the adb.
Oddly enough my already running emulators wouldn't show up while Run/Debug-ing a new Project/Activity.
A somewhat of a adhoc approach, here's how I fixed it.
I opened the Devices View, which shows up the currently running emulators, mine wasn't there.
So I clicked on the little down-arrow & clicked on "Restart ADB" (or something like that). And presto! as the adb rebooted the Devices View listed my emulator (along with other stuff I didn't quite understand). Viewing the LogCat console showed the entire trace. And I could launch my app into the currently running emulator.
I had tried to restart adb numerous times through the console but it didn't made a difference. From Eclipse, it however did.
P.S. ADB still pesters by not listing the emulator & the same approach fixes it everytime. (Restart via Devices View)

it sounds like you haven't yet added the program.
Right click on your android project
select run as
select android application.

Related

Android Studio - Logcat not working for emulator but OK for phone

I'm very new to Android Studio. I have been using it on Windows but the machine was too old to run any of the emulators so I installed it (via Ubuntu Software store) on a laptop running Unbuntu 18.04.
It all seems to work OK except the Logcat does not show anything. Sometimes, after cold starting the emulator, I get some output to the Logcat but then it just halts and nothing I do (see below) causes it to output anything else.
I cannot get ANY output when running an app.
I have searched extensively here and via Google and tried the following:
restarted the Studio
restarted logcat
killed and restarted adb
invalidate caches and restart AS
deleting and recreating AVDs
use logcat via AS built in terminal and external shell :
./adb -s emulator-5554 logcat
and get:
Unable to open log device '/dev/log/main': No such file or directory
NB: When using an attached phone e.g. Moto G. the logcat works fine. I get all the system output and the app output works as expected.
Thanks in advance
2019-12-14 UPDATE: when the emulator is running it shows the active processes (see screenshot) in the drop down, including my app but NO entries. Not sure if this gives anyone a clue? It is clearly communicating with the emulator in some way.
2019-12-16 UPDATE: Started in from scratch. Installed MX Linux 19 and fresh Studio install. Created new AVD. EXACTLY THE SAME!!! This is so ridiculous. Anyone, please?
sometimes you might be trying to use a gun to kill a fly. For a try, ensure that the emulator you have run is actually selected in logcat like in this screen shot
.

New instance of android emulator starting on each run

I've checked every single related post (I know there're a lot) but still no one common solution works for me.
Almost every time users solve this issue by:
adb kill-server
sudo start-server
But not in my case. I do that and nothing happens. Nevertheless I cannot run my App in emulator, I can do it in normal physical device and it works!
I'm on latest OS X (ML). Latest for today sdk, adt, eclipse(kepler). Everything is up to date.
When I check adb devices, it's empty. Or when I switch to DDMS - same.
When running an app, it's starting displaying normal messages in console:
[2013-07-03 18:59:42 - NewApp] ------------------------------
[2013-07-03 18:59:42 - NewApp] Android Launch!
[2013-07-03 18:59:42 - NewApp] adb is running normally.
[2013-07-03 18:59:42 - NewApp] Performing vista.Start activity launch
[2013-07-03 18:59:49 - NewApp] Launching a new emulator with Virtual Device 'Hihi'
But after, the unlock screen is shown, the app appears to be not installed on the emulator.
I've tried different API levels and also reinstalled all eclipse, adt,etc. As well as deleted and recreated the virtual device.
The thing I've noticed is that the debug mode is OFF in the emulator. And if I change it and run again, it still OFF.
I'm really sorry for reposting, but I couldn't find exactly the same problem description.
PD: The other thing I've noticed is that sometimes eclipse prompts for something to allow or not with warning window. But it appears/disappears so fast that there's no time to read and answer.
Do I have all correct paths?
~/android-sdk-macosx/platform-tools/adb
~/android-sdk-macosx/tools/emulator
~/.android/avd/
/Applications/eclipse
keep your emulator on.. and reset your adb from device view

Eclipse keeps starting new emulators

I'm busy learning how to build apps for Android, and I come across a very awkward problem.
When I run my application (with the green circle with the play-icon in it), it starts an Android emulator (like it should), but the application doesn't start once the emulator is booted. When I click the run-button again, it tries to start a second android-emulator. In the console-tab it gives the following messages:
[2011-11-07 20:57:15 - ScrollView Demo] Android Launch!
[2011-11-07 20:57:15 - ScrollView Demo] adb is running normally.
[2011-11-07 20:57:15 - ScrollView Demo] Performing testapp.scrollviewdemo.MainActivity activity launch
[2011-11-07 20:57:15 - ScrollView Demo] Automatic Target Mode: launching new emulator with compatible AVD 'Android_emulator'
[2011-11-07 20:57:15 - ScrollView Demo] Launching a new emulator with Virtual Device 'Android_emulator'
[2011-11-07 20:57:18 - Emulator] WARNING: Data partition already in use. Changes will not persist!
[2011-11-07 20:57:18 - Emulator] WARNING: SD Card image already in use: C:\Users\Roy\.android\avd\Android_emulator.avd/sdcard.img
[2011-11-07 20:57:18 - Emulator] WARNING: Cache partition already in use. Changes will not persist!
It's like Eclipse doesn't recognize the emulators it starts...
Weird thing is, sometimes it does recognize it, but most of the times it doesn't.
If it makes any difference: I'm running Eclipse IDE for Java Developers (Indigo Service Release 1) with ADT 15.0.0 on Win7 Home Premium 64bit
If the emulator has started, that may mean adb is acting up. Not sure on windows, but on mac/linux I do the following:
adb kill-server
sudo adb devices
You could try that (get rid of the 'sudo' business).
I don't think you're waiting long enough. There's 3 stages to go through
Wait until the android logo disappears on startup (unless you've disabled boot animations)
Wait for the locked screen to come up.
Wait for the app to be actually installed onto the device (you'll get a message saying 'Installing nameOfApp on Emulator device #whatever')
This whole process will take anywhere from 3 - 15 minutes. To speed things up, make sure you leave the emulator ON then you just need to do step 3.
If you try to click Run again before this is all done, it will incorrectly assume no emulator is up and start up a new one.
You can also make sure your emulator is ok by selecting Window -> Android SDK and AVD Manager and selecting Virtual Devices. You can even start a device up first (stages 1 and 2) without actually installing your app. You can also check the status of the device using DDMS (and make sure that it isn't actually installing your app and then silently crashing) by selecting DDMS at the top-right of Eclipse or Window -> Open Perspective -> Other -> DDMS
Hope this helps.
best way to just kill the current running server
adb kill-server
After starting the emulator, check the emulator name has been reflected in Eclipse->DDMS->Devices. If it is mentioned as "Online", you can just run the application and it wont launch new emulator. If it is mentioned as "Offline", go to "View Menu" option(a small down arrow button in Devices window) and reset the adb. This will restart adb and will make emulator Online.
Go to Command prompt and set the path where the adb is stored and give the following command:
First kill the adb by giving the command adb kill-server
and then start the adb by giving the command adb start-server(for windows)
Otherwise there is another option Go to DDMS and restart the adb.
I do not believe what you are witnessing is a bug at all.
You probably do not need to restart the adb.
What is happening is this:
If the current emulator you are running does not fit the minimum SDK of project you trying to run.
The Android SDK manager will run an emulator that does fit the minimum sdk requirement.

Unable to upload file to device from eclipse

I'm running into an error where I can no longer upload/run my android app from eclipse on to a real device. I don't recall having changed anything particular that would cause this error. here's my error log from console in Eclipse:
[2011-05-25 16:58:01 - Child Protector] Android Launch!
[2011-05-25 16:58:01 - Child Protector] adb is running normally.
[2011-05-25 16:58:01 - Child Protector] Performing com.example.hello.Main activity launch
[2011-05-25 16:58:03 - Child Protector] Uploading Hello.apk onto device '982394670345'
[2011-05-25 16:58:09 - Child Protector] Failed to upload Hello.apk on device '982394670345'
[2011-05-25 16:58:09 - Child Protector] java.io.IOException: Unable to upload file: null
[2011-05-25 16:58:09 - Child Protector] Launch canceled!
I'm using Eclipse on Ubuntu 9.10. I've looked at the other threads and none of the methods worked (although their error log is slightly different). My adb logcat can't print anything, because the connection never was made (im guessing). I'm able to do a manual "adb install Hello.apk" and that is fine; but i do not want to have to do it each time from terminal (because i also don't know how to use the adb uninstall command - no clue where the file on phone is).
i've tried:
restarting computer
restarting phone
restarting eclipse
turning off and on Debugging mode
pulling and re-plugging USB cable to phone
also note, the app seems to be able to install on the emulator if i right click the project in Eclipse and select 'Run as -> Android App'. but won't work on my phone... I have an android 2.1 Samsung Galaxy S
Also, I'm relatively new to Android, so please provide details in explanation, as my knowledge is limited.
Go to Eclipse Preferences, then Android, then DDMS. Set the timeout value for ADB to 10000 ms.
You may have to create a new Eclipse project and copy everything over.

Android emulator fails to start

I searched google this morning and could not find an answer, so I would like folks on stackoverflow to help.
Until yesterday, everything was perfect, when I ran my android app from eclipse the emulator used to load, and I could test everything.
I used it today and the emulator does not load.
Here is the dump from the console
[2010-12-02 10:39:42 - HomeScreen] ------------------------------
[2010-12-02 10:39:42 - HomeScreen] Android Launch!
[2010-12-02 10:39:42 - HomeScreen] adb is running normally.
[2010-12-02 10:39:42 - HomeScreen] Performing com.Dyforms.XMLGui activity launch
[2010-12-02 10:39:42 - HomeScreen] Automatic Target Mode: launching new emulator with compatible AVD 'newAVD'
[2010-12-02 10:39:42 - HomeScreen] Launching a new emulator with Virtual Device 'newAVD'
I can see emulator.exe available in the task manager, but I do not see it launched.
Can you guys guide me what could be wrong?
Rupin
A restart of the machine did the trick..It works fine now
Check out RunConfiguration for project. inside it "Deployment Target Mode " is Automatic/Manual , Please if there is emulator you tried yesterday exists or not. - thanks
Try running the emulator standalone from the command line, in particular try doing it with the option to wipe the userdata partition in case things got messed up. It will boot a bit slower the first time after that as it has to re-dex-opt everything, but hopefully it should boot. Also, as soon as it seems like it's trying to run, adb shell into it and do a ps to see what it's up to.
There are also command line options to start the emulator with kernel log output, etc.
Or you could try creating a clean new avd.
Quit skype if it is running. It must use the same port as skype. When I quit it worked fine.
I struggled with the same problem. The CPU ran near 100% and the emulator never completed loading. It was only when I removed all the Apple products (iTunes, iCloud etc) from my PC that resolved the issue resolved. My PC became a lot more responsive too!

Categories

Resources