Android ICS 4.0 NDK NewStringUTF is crashing down the App

前端 未结 10 1987
长情又很酷
长情又很酷 2020-12-02 15:01

I have a method in JNI C/C++ which takes jstring and returns back jstring some thing like as below,

  NATIVE_CALL(jstring, method)(JNIEnv * env, jobject obj         


        
10条回答
  •  猫巷女王i
    2020-12-02 15:24

    I resolved this issue by returning byte array instead of String. On the Java side i am now converting the Byte array to Strings .Works fine! Stay away from using NewStringUTF() for Android 4.0 and above as there is already a bug reported on Google Android NDK.

提交回复
热议问题