1

i use NetBeans to develop an HTML5 cordova-based android app. Netbeans and android SDK is installed on an linux Workstation - Ubuntu 14.04 (x64).

For that, I like to run the app insight an existing (and running) android emulator (AVD). The AVD works fine and is also reachable using telnet:

$ telnet localhost 5554
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: type 'help' for a list of commands
OK

But: if I try to execute/run the app in NetBeans, NB returns 2 dialog boxes:

info: Connecting to android device...

and

error: Please run Android Emulator

I had the same setup on windows running out of the box. But it is not working on ubuntu.

So my question is: how to debug this problem and what could be the reason, why NetBenas does not find the emulator?

Is there an NetBeans setting somewhere?

//Edit: with the Help of @ladar i found out, that an library is missing:

libstdc++.so.6: cannot open shared object file

This library is needed by adb, which is startet by NetBeans. But: After installing libx32stdc++6 and libx64stdc++6 the error still exists. adbis unable to locate that library:

$ ldd /opt/android-sdk-linux/platform-tools/adb
    linux-gate.so.1 =>  (0xf778d000)
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf7632000)
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf762d000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7610000)
    libstdc++.so.6 => not found
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf75ca000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf75ad000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf73fd000)
    /lib/ld-linux.so.2 (0xf778e000)

The 32bit files was placed in. /usr/libx32/. So I added an link to /lib/i386-linux-gnu/. Running strace recognizances the library at its new possition, but still resuolts in an error:

$ strace /opt/android-sdk-linux/platform-tools/adb
execve("/opt/android-sdk-linux/platform-tools/adb", ["/opt/android-sdk-linux/platform-"...], [/* 64 vars */]) = 0
[ Process PID=15558 runs in 32 bit mode. ]
brk(0)                                  = 0xfffffffff7913000
[...]
open("/lib/i386-linux-gnu/cmov/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/lib/i386-linux-gnu/cmov", 0xffa155b0) = -1 ENOENT (No such file or directory)
open("/lib/i386-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\243\4\0004\0\0\0"..., 512) = 512
close(3)                                = 0
stat64("/lib/i386-linux-gnu", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/usr/lib/i386-linux-gnu/tls/i686/sse2/cmov/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/i386-linux-gnu/tls/i686/sse2/cmov", 0xffa155b0) = -1 ENOENT (No such file or directory)
[...]
writev(2, [{"/opt/android-sdk-linux/platform-"..., 41}, {": ", 2}, {"error while loading shared libra"..., 36}, {": ", 2}, {"libstdc++.so.6", 14}, {": ", 2}, {"cannot open shared object file", 30}, {": ", 2}, {"No such file or directory", 25}, {"\n", 1}], 10/opt/android-sdk-linux/platform-tools/adb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
) = 155
exit_group(127)                         = ?
+++ exited with 127 +++

...and I have no idea why....

The Bndr
  • 13,204
  • 16
  • 68
  • 107
  • The Android emulator is running when you're trying to run the project, right? NetBeans won't start it by itself. Also you might want to look to IDE log (http://wiki.netbeans.org/FaqLogMessagesFile), perhaps there will be something. There could be also issue if you have Android device connected (with USB debugging) to PC at the same time as emulator is running – ladar Nov 21 '14 at 10:05
  • @ladar yes, android emulator is running (long) before trying to run the project. And: there is no Android device connected on USB. I will take a look into the IDE log. Thank you. – The Bndr Nov 21 '14 at 10:26
  • @ladar The link to the Wiki/logFile location was an good advice. Thank you. The reason is probably an missing lib for adb `libstdc++.so.6: cannot open shared object file`. Installing `libx32stdc++6` and `libx64stdc++6` didn't solve that problem.:-/ But now I have an way to investigate the problem. – The Bndr Nov 21 '14 at 11:09
  • You could try to run Cordova app on emulator using command line API (http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html#The%20Command-Line%20Interface). This would help you to find out if NetBeans are related to your issue or if it is not related to NetBeans – ladar Nov 21 '14 at 12:19
  • @ladar Now, I think, NetBeans is not releated to this issue, because the same error appears, if I run `adb` from command line. But if I change the title of this question, other users with the same "NetBeans problem" will not find this thread. – The Bndr Nov 21 '14 at 13:13

1 Answers1

1

I like to answer my own question for the case, that someone has the same issue: installing the 32bit versions of several packages did not solve the problem.

The point is to install the ...-dev packages too. The following line solves the problem:

sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev

The Bndr
  • 13,204
  • 16
  • 68
  • 107