5

I can't debug android ndk app on Windows. It seems it is a new line problem on Windows

c:\Android\android-ndk-r9c\samples\hello-jni>..\..\ndk-build DUMP_APP_ABI
all

c:\Android\android-ndk-r9c\samples\hello-jni>

On Linux it is

hello-jni$ ../../ndk-build DUMP_APP_ABI
all
hello-jni$

There is no line after all on Linux

I use unmodified hello-jni from android-ndk-r9c

I also compared size of every unzipped file and they are original. It is clean unmodified NDK from Google. It is able to compile and do JavaDebug but not NativeDebug. (on Windows)

My questions is: What I am doing wrong? Does someone can confirm that unmodifed Android NDK r9c (latest today) is able to do native debugging with Eclipse+NDKPlugin.

PS I forgot to mention that when I do Native Debug I get

[2013-11-18 14:38:50 - HelloJni] Unknown Application ABI: 
[2013-11-18 14:38:50 - HelloJni] 
[2013-11-18 14:38:50 - HelloJni] Unable to detect application ABI's

Just like in that question

Community
  • 1
  • 1
Max
  • 6,286
  • 5
  • 44
  • 86
  • 1
    is it 32-bit or 64-bit NDK? – Alex Cohn Jan 08 '14 at 14:02
  • 1
    Good catch! I have just checked: it's the `prebuilt/windows/bin/make.exe` in both 32 and 64 bit versions of **NDK r9c**. – Alex Cohn Jan 08 '14 at 14:29
  • Thank You! 64 bit. You answered my question. Please add answer and I will mark it as answered. Thanks again. – Max Jan 08 '14 at 16:03
  • 1
    You mean, 32 bit version works? Oh, great! – Alex Cohn Jan 08 '14 at 16:11
  • No. I have 64bit NDK on both Windows and Linux. Linux works and Windows don't. I am downloading 32 bit NDK now. – Max Jan 08 '14 at 16:20
  • 1
    I downloaded r9c 32bit and I get same error. It is on both 32 and 64 bit NDK on Windows. – Max Jan 08 '14 at 17:38
  • 1
    Apparently, some people succeeded with this, see http://stackoverflow.com/questions/17910859/ndk-debugging-with-r9-works-on-w7-64-but-gives-me-issues-in-xp. The key difference may be around cygwin installation. – Alex Cohn Jan 08 '14 at 20:27
  • The bug mentioned there is different. There is no `Unknown Application ABI:` that I forgot to mention in my question. That in that post with dbg 32 bit was fixed in `r9b`. – Max Jan 08 '14 at 21:19
  • 2
    Ha! That's the point: your question was: "is it possible to receive valid DUMP_APP_ABI on Windows in NDR r9?". Their link proves that it is possible. – Alex Cohn Jan 09 '14 at 07:28
  • 1
    That thread made me think it is only bug in NDK on Windows. http://stackoverflow.com/questions/20047348/unknown-application-abi-while-debug-as-native-application I was wrong it has other bugs. – Max Jan 09 '14 at 12:01

1 Answers1

4

My understanding is that the the issue is which make is used by ndk-gdb. See ndk-gdb on windows: when cygwin's make is used, all well; if cygwin make is not installed, ndk-gdb fails. Here is the summary from Debugging Android NDK, Under Windows:

  1. add android:debuggable="true" flag to <application tag in AndroidManifest.xml
  2. in cmd (windows' command prompt): invoke ndk-build with NDK_DEBUG=1
  3. in cygwin bash: run ndk-gdb
Community
  • 1
  • 1
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307