Projects not deployed to emulator

98 views
Skip to first unread message

Age Bosma

unread,
Jul 12, 2013, 8:31:14 AM7/12/13
to nbandroi...@googlegroups.com
Hi,

I'm trying to run a project on a device emulator, but it does not get deployed to the emulator for some reason. The projects builds with no errors, it does start the emulator, but the app is nowhere to be found on the device. I've tested it with a newly created Android project in NetBeans but that does not make a difference.
I've got 3 AVD's defined (API level 8, 10 and 16) and the appropriate emulator does start based on the defined target.

Using:
- NetBeans 7.3.1
- NBAndroid 1.142
- Ubuntu 13.04 (x64)
- Android SDK Manager 22.0.1
- Oracle Java JDK 7u25

Some observations:
- The tabs "Android devepment" and "Android emulator" in the NetBeans "Output" window remain empty.
- The "Android Devices" section in the NetBeans "Services" window does not list any device (running or not running)
- The option "Restart ADB" from the "Android Devices" context menu gives me: "Android Debug Bridge restart failed"

What can be the cause of the problem or how can I find out what's going wrong?

Yours,

Age

Radim Kubacki

unread,
Jul 12, 2013, 8:43:18 AM7/12/13
to Age Bosma, nbandroi...@googlegroups.com
Hi,

it is possible that IDE log file (http://www.nbandroid.org/p/contacts.html) will have some extra information. From what you wrote it is obvious that we need to find why the IDE - ADB - emulator chain is not working properly.

Some ideas: check for stale adb processes. Interference with other tools talking to ADB (another IDE)? Try to start adb from command line to see if there is some output visible and to check if it runs correctly. You can try with a real device too but I think it will not make a difference at the moment.

-Radim


2013/7/12 Age Bosma <ageb...@gmail.com>

--
To find more visit http://www.nbandroid.org/
---
You received this message because you are subscribed to the Google Groups "NBAndroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nbandroid-disc...@googlegroups.com.
Visit this group at http://groups.google.com/group/nbandroid-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Age Bosma

unread,
Jul 13, 2013, 12:50:03 PM7/13/13
to nbandroi...@googlegroups.com, Age Bosma
Thank you for your reply.


On Friday, 12 July 2013 14:43:18 UTC+2, Radim Kubacki wrote:
Hi,

it is possible that IDE log file (http://www.nbandroid.org/p/contacts.html) will have some extra information. From what you wrote it is obvious that we need to find why the IDE - ADB - emulator chain is not working properly.


The log does not give me much to go on: http://pastebin.com/y1fXT9V9
The last 3 entries get added when running the app and an emulator is started. No entry is added when trying to restart ADB.

 
Some ideas: check for stale adb processes. Interference with other tools talking to ADB (another IDE)? Try to start adb from command line to see if there is some output visible and to check if it runs correctly. You can try with a real device too but I think it will not make a difference at the moment.
 

I'm not running any other applications while trying, just NetBeans. Running adb manually from the command line gives me the following the first time:

---------------------------------------------------------------------------
forage@Khazad-dum:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
---------------------------------------------------------------------------

When an emulator is started from NetBeans it will have "emulator-5554    device" listed.

Age

Radim Kubacki

unread,
Jul 13, 2013, 2:17:06 PM7/13/13
to Age Bosma, nbandroi...@googlegroups.com
Few more questions and/or ideas:
- I'd try to start adb+emulator from command line and try to deploy the app as described in http://developer.android.com/tools/building/building-cmdline.html Just to make sure that this part is working correctly
- related to this: are you sure that its port is accessible (firewall?)
- maybe try with Sun's Java 6
- when ADB is running and emulator launched can you see it in Services tab?

-Radim


2013/7/13 Age Bosma <ageb...@gmail.com>

--

Age Bosma

unread,
Jul 13, 2013, 3:45:23 PM7/13/13
to nbandroi...@googlegroups.com, Age Bosma


On Saturday, 13 July 2013 20:17:06 UTC+2, Radim Kubacki wrote:
Few more questions and/or ideas:
- I'd try to start adb+emulator from command line and try to deploy the app as described in http://developer.android.com/tools/building/building-cmdline.html Just to make sure that this part is working correctly

Works like a charm. The app gets installed successfully when doing it manually.
 
- related to this: are you sure that its port is accessible (firewall?)

I've got no firewall running.
 
- maybe try with Sun's Java 6

Tried the manual running and through NetBeans (specifying the default JDK for NetBeans to use) using Java 6, with the same result. Manual works, through NetBeans fails.
 
- when ADB is running and emulator launched can you see it in Services tab?


No, not when starting the emulator manually, nor when starting it through NetBeans. Restarting NetBeans while having an emulator open does not make a difference. I.e. the "Android Devices" section is available but it does not list any devices under it.

Attached you'll find a screenshot of all SDK packages I've got installed. I'm not missing any crucial packages, am I?

Age
Screenshot from 2013-07-13 21:43:00.png

Radim Kubacki

unread,
Jul 13, 2013, 4:06:20 PM7/13/13
to Age Bosma, nbandroi...@googlegroups.com
This is weird and I do not know what is wrong. So I added some logging to let us see what happens when IDE starts - it tries to restart ADB process and connect to it but it seems that the communication is broken in your case.
The plugin version with extra logging was just pushed (1.143) to auto update and you can try it.

Changing the log level to FINER or FINEST can give us even more data about the whole communication but perhaps this won't be necessary.

-Radim


2013/7/13 Age Bosma <ageb...@gmail.com>


--

Age Bosma

unread,
Jul 13, 2013, 6:23:03 PM7/13/13
to nbandroi...@googlegroups.com, Age Bosma
Many thanks for you swift support :-)


On Saturday, 13 July 2013 22:06:20 UTC+2, Radim Kubacki wrote:

The plugin version with extra logging was just pushed (1.143) to auto update and you can try it.


The log now gave me a couple of "error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory" errors.
Which was caused by not having the 32 bit version of the library installed on my 64 bit system. Installing them solved the problem. ADB can be restarted again from NetBeans, apps get pushed to the emulator now and the running emulators get listed in the "Services" section again.

For (Ubuntu) users running into the same problem, execute either:

-----------------------------------------
sudo apt-get install libncurses5:i386

-----------------------------------------

or

-----------------------------------------
sudo apt-get install lib32ncurses5
-----------------------------------------

Whatever takes your fancy.

What I do not understand is why it is required to have the 32 bit version of the lib installed when using NetBeans, but all works fine when running the emulator manually without it. As you can see from the log at http://pastebin.com/12w5nBEw it is "adb version" which causes the error. Running the same from the command line gives me the version as expected without having the 32 bit version of the lib installed.

Yours,

Age

Radim Kubacki

unread,
Jul 14, 2013, 3:35:06 AM7/14/13
to Age Bosma, nbandroi...@googlegroups.com
Nice, I am glad we were able to solve this. Now it is simpler to find some related docs about this like:
http://developer.android.com/sdk/installing/index.html that has troubleshooting Ubuntu section recommending to install ia32libs package. You will get 32-bit version of curses as its dependency.

Thanks for your patience,
Radim


2013/7/14 Age Bosma <ageb...@gmail.com>

--
Reply all
Reply to author
Forward
0 new messages