当前位置: 首页 > 知识库问答 >
问题:

JNI在应用程序中检测到错误:调用了JNI NewGlobalRef,但带有挂起的异常java.lang.NosuchFielderRror

后星河
2023-03-14
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: JNI NewGlobalRef called with pending exception java.lang.NoSuchFieldError: no "I" field "mNativePtr" in class "Landroid/os/Parcel;" or its superclasses
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.String) (Runtime.java:-2)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.String java.lang.Runtime.doLoad(java.lang.String, java.lang.ClassLoader) (Runtime.java:435)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void java.lang.Runtime.loadLibrary(java.lang.String, java.lang.ClassLoader) (Runtime.java:370)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void java.lang.System.loadLibrary(java.lang.String) (System.java:1076)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void fr.limsi.registration.utils.NativeInterface.<clinit>() (NativeInterface.java:12)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void fr.limsi.registration.utils.NativeInterface.tangoInitServices() (NativeInterface.java:-2)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void fr.limsi.registration.activities.ProjectViewActivity.onStart() (ProjectViewActivity.java:63)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.Instrumentation.callActivityOnStart(android.app.Activity) (Instrumentation.java:1238)
    05-15 14:08:03.177 21078-21078/fr.limsi.registration A/art: art/runtime/java_vm_ext.cc:410]   at void android.app.Activity.performStart() (Activity.java:6302)

共有1个答案

赏育
2023-03-14

我在Google Tango库中遇到了这个问题,但我还没有找到解决方案。对不起,我还没有足够的业力来评论。

如果你使用的是谷歌Tango设备,我想你的问题和我的一样。谷歌探戈的东西。

编辑:

public class MainActivity extends AppCompatActivity {

// Used to load the 'native-lib' library on application startup.
static {
    // This project depends on tango_client_api, so we need to make sure we load
    // the correct library first.
    if (com.projecttango.examples.cpp.util.TangoInitializationHelper.loadTangoSharedLibrary() ==
            com.projecttango.examples.cpp.util.TangoInitializationHelper.ARCH_ERROR) {
        Log.e("TangoJNINative", "ERROR! Unable to load libtango_client_api.so!");
    }
    System.loadLibrary("native-lib");
}
 类似资料: