Android : JNI ERROR (app bug): local reference table overflow (max=512)

后端 未结 1 1940
南笙
南笙 2021-01-12 20:25

I have an android app which has native code. The native code needs to get a particular value from java code; this value updates regularly, so I need to get it when I need to

相关标签:
1条回答
  • 2021-01-12 21:13

    You need to delete the local ref to the value returned by

    env->CallStaticObjectMethod(bridgeClass, method)
    

    as follows:

    jobject returnValue = env->CallStaticObjectMethod(bridgeClass, method);
    // ...
    env->DeleteLocalRef(returnValue);
    
    0 讨论(0)
提交回复
热议问题