Eclipse will report " Method Newstringutf () could not being resolved "error. Please refer to http://stackoverflow.com/questions/15899813/eclipse-method-newstringutf-could-not-be-resolved to eliminate it.
go to the project ' s Properties, C + + general Code Analysis.click," Use Project Settings " radio button (or "Configureworkspace Settings ..." button). Disable (uncheck) the "Method Cannotbe resolved" checkbox. Click "Apply," "OK." Then Foryour project, refresh, clean, refresh, build.
Then , set breakpoints in gdb and run other debug commands
(gdb) b hello-jni.c:62
No symbol table is loaded. Use the "file" command.
Breakpoint 1 (hello-jni.c:62) pending.
(GDB) C
Continuing.
Exception in thread Thread-3:
Traceback (most recent Calllast):
File "C:\Python34\lib\threading.py", line 920, In_bootstrap_inner
Self.run ()
File "C:\Python34\lib\threading.py", line 868, in run
self._target (*self._args, **self._kwargs)
File "C:\Users\Qingxu_Li\AppData\Local\Android\android-ndk-r10d\ndk-gdb.py", L
Ine 353, in Async_stderr
output_fn (line.replace (' \ R ', '). replace (' \ n ', ') ')
typeerror:expected Bytes,bytearray or Buffer compatible object
Breakpoint 1,java_com_example_hellojni_hellojni_stringfromjni (
env=0x41c77e00, thiz=0xd2e00019) atjni/hello-jni.c:62
*env->newstringutf (env, "Hello from JNI! ) Compiled with AB
I "ABI". ");
(GDB) bt
#0 java_com_example_hellojni_hellojni_stringfromjni (env=0x41c77e00,
thiz=0xd2e00019) at jni/hello-jni.c:62
#1 0x40b81550 in?? ()
#2 0x40b81550 in?? ()
BackTrace Stopped:previousframe identical to this frame (corrupt stack?)
(GDB) frame
#0 java_com_example_hellojni_hellojni_stringfromjni (env=0x41c77e00,
thiz=0xd2e00019) at jni/hello-jni.c:62
*env->newstringutf (env, "Hello from JNI! ) Compiled with AB
I "ABI". ");
(GDB)