1

我猜标题很不言自明......这是在java中调用函数

...
char[] path = stringPath.toCharArray();
char[] result = new char[256];

Log.e("ndk", "starting native method"); 

pcmEncoder.encodePCM(path, result);
...

这是我认为可能是错误的C代码:

JNIEXPORT jint JNICALL Java_cz_hundredspires_que_SignalProcessor_encodePCM (JNIEnv *env, jobject obj, jcharArray jcha1, jcharArray jcha2)
{
char *FileName = (*env)->GetCharArrayElements(env, jcha1, NULL);
char *BestOutput = (*env)->GetCharArrayElements(env, jcha2, NULL);
...
(*env)->ReleaseCharArrayElements(env, FileName, jcha1, 0);
(*env)->ReleaseCharArrayElements(env, BestOutput, jcha2, 0);
return 1;
}

jcha1 是文件路径,jcha2 是写入孔函数结果的数组,我以后应该可以在 java 代码中读取它。

我解决不了。任何人都可以帮助我吗?谢谢

编辑:抱歉,有一个有趣的 LogCat 条目:

05-03 22:38:43.093: E/JavaBinder(13929): !!! FAILED BINDER TRANSACTION !!!

编辑2:

05-03 22:55:03.705: E/ndk(14279): starting native method
05-03 22:55:03.825: I/DEBUG(11836): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-03 22:55:03.825: I/DEBUG(11836): Build fingerprint: 'google/passion/passion:2.3.6/GRK39F/189904:user/release-keys'
05-03 22:55:03.825: I/DEBUG(11836): pid: 14279, tid: 14279  >>> cz.hundredspires.que <<<
05-03 22:55:03.825: I/DEBUG(11836): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 12cdaa90
05-03 22:55:03.825: I/DEBUG(11836):  r0 00000025  r1 afd42320  r2 44ada300  r3 00171e90
05-03 22:55:03.825: I/DEBUG(11836):  r4 00000000  r5 00172010  r6 00000000  r7 00000000
05-03 22:55:03.825: I/DEBUG(11836):  r8 bebfd0c8  r9 44adcccc  10 0000abe0  fp 00000000
05-03 22:55:03.825: I/DEBUG(11836):  ip 00000000  sp bebfce00  lr afd149c1  pc 80400aea  cpsr 60000030
05-03 22:55:03.825: I/DEBUG(11836):  d0  6472656767756265  d1  3fd6666666666666
05-03 22:55:03.825: I/DEBUG(11836):  d2  002f006400720076  d3  bff0000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d4  4053131840531258  d5  405313d040535550
05-03 22:55:03.825: I/DEBUG(11836):  d6  40531480405355f8  d7  3ff0000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d8  0000000000000000  d9  0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d10 0000000000000000  d11 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d12 0000000000000000  d13 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d14 0000000000000000  d15 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d16 44b14df040022da0  d17 0000d8790000d879
05-03 22:55:03.825: I/DEBUG(11836):  d18 0000000000000000  d19 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d20 0000000000000000  d21 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d22 0000000000002902  d23 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d24 0000000000008790  d25 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d26 0000000000008783  d27 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d28 0000000000008853  d29 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  d30 00000000000000d0  d31 0000000000000000
05-03 22:55:03.825: I/DEBUG(11836):  scr 60000010
05-03 22:55:03.895: I/DEBUG(11836):          #00  pc 00000aea  /data/data/cz.hundredspires.que/lib/libpcm_encoder.so (Java_cz_hundredspires_que_SignalProcessor_encodePCM)
05-03 22:55:03.895: I/DEBUG(11836):          #01  lr afd149c1  /system/lib/libc.so
05-03 22:55:03.895: I/DEBUG(11836): code around pc:
05-03 22:55:03.895: I/DEBUG(11836): 80400ac8 dcf1429e a018f8cd ed9f9a08 9b053b21 
05-03 22:55:03.895: I/DEBUG(11836): 80400ad8 7b21ed9f ed9f9804 eddf1b24 f8dd0a27 
05-03 22:55:03.895: I/DEBUG(11836): 80400ae8 f853b018 ee054022 eeb84a90 46236be5 
05-03 22:55:03.895: I/DEBUG(11836): 80400af8 6bc0eeb5 fa10eef1 eeb0bf54 eeb05b47 
05-03 22:55:03.895: I/DEBUG(11836): 80400b08 42b85b43 f04fbfcc f04f3eff 9f050e01 
05-03 22:55:03.895: I/DEBUG(11836): code around lr:
05-03 22:55:03.895: I/DEBUG(11836): afd149a0 4798680b bf00bd10 0002db88 ffffff28 
05-03 22:55:03.895: I/DEBUG(11836): afd149b0 4a054b04 b510447b 6819589b 4798684b 
05-03 22:55:03.905: I/DEBUG(11836): afd149c0 bf00bd10 0002db6c ffffff28 f8df4b05 
05-03 22:55:03.905: I/DEBUG(11836): afd149d0 447bc018 f853b510 681a300c 47986893 
05-03 22:55:03.905: I/DEBUG(11836): afd149e0 bf00bd10 0002db4e ffffff28 f8df4b05 
05-03 22:55:03.905: I/DEBUG(11836): stack:
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdc0  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdc4  afd477a4  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdc8  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdcc  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdd0  bebfd0c8  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdd4  afd149c1  /system/lib/libc.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdd8  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcddc  afd18afb  /system/lib/libc.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfcde0  afd477a4  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcde4  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcde8  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdec  afd18611  /system/lib/libc.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdf0  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdf4  00172010  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdf8  df002777  
05-03 22:55:03.905: I/DEBUG(11836):     bebfcdfc  e3a070ad  
05-03 22:55:03.905: I/DEBUG(11836): #00 bebfce00  44248f70  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce04  47389032  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce08  afd477a4  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce0c  47388749  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce10  00000025  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce14  00171e90  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce18  00000000  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce1c  bebfcdb0  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce20  44ada300  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce24  00000028  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce28  0000abe0  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce2c  4053c338  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce30  acaa5001  
05-03 22:55:03.905: I/DEBUG(11836):     bebfce34  aca16d98  /system/lib/libdvm.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfce38  aca16e10  /system/lib/libdvm.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfce3c  aca16cb8  /system/lib/libdvm.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfce40  aca16ce0  /system/lib/libdvm.so
05-03 22:55:03.905: I/DEBUG(11836):     bebfce44  80403138  
05-03 22:55:04.615: I/BootReceiver(783): Copying /data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
05-03 22:55:04.625: I/WindowManager(783): WIN DEATH: Window{40812f60 cz.hundredspires.que/cz.hundredspires.que.TerminalActivity paused=false}
05-03 22:55:04.625: I/ActivityManager(783): Process cz.hundredspires.que (pid 14279) has died.
05-03 22:55:04.635: D/Zygote(748): Process 14279 terminated by signal (11)
05-03 22:55:04.675: W/InputManagerService(783): Got RemoteException sending setActive(false) notification to pid 14279 uid 10067
05-03 22:55:07.195: D/dalvikvm(11075): GC_CONCURRENT freed 96K, 44% free 3771K/6727K, external 0K/0K, paused 2ms+3ms
05-03 22:55:07.255: D/Finsky(11075): [1] 5.onFinished: Installation state replication succeeded.
4

0 回答 0