我在同一个JNI库中实现了两个对象。它工作正常,直到我为两个类实现了两个相同的方法。定义如下:
的Class1:
jobjectArray JNICALL Java_com_applications_Class1_GetRectangles
(JNIEnv *env, jobject obj)
等级2:
jobjectArray JNICALL Java_com_applications_Class2_GetPoints
(JNIEnv *env, jobject obj)
之后,我的应用程序开始崩溃,从库中调用任何JNI方法。我知道存在冲突。是否有任何方法可以保留这些方法并使其正常工作?
从崩溃点开始的Logcat转储并没有多说:
04-16 22:07:12.573 I/JNI NativePointDetector( 7171): Calling Process method
04-16 22:07:12.664 W/fb4a(:<default>):QuickExperimentControllerImpl( 7248): Exposure of experiment com.facebook.push.mqtt.service.MqttServiceProcessSelection@23144964 occurred when no user was logged in
04-16 22:07:12.674 W/CameraService( 185): Disconnecting camera client 0xb320c090 since the binder for it died (this pid 185)
04-16 22:07:12.677 I/WindowState( 530): WIN DEATH: Window{1ecf2e2e u0 com.applications.MyApp/com.applications.MyApp.MainActivity}
04-16 22:07:12.677 W/WindowManager( 530): Force-removing child win Window{3283efbd u0 SurfaceView} from container Window{1ecf2e2e u0 com.applications.MyApp/com.applications.MyApp.MainActivity}
04-16 22:07:12.680 E/qdhwcomposer( 179): Failed to send data over socket: Bad file number
04-16 22:07:12.687 W/WindowManager( 530): Failed looking up window
04-16 22:07:12.687 W/WindowManager( 530): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@2ef387eb does not exist
04-16 22:07:12.687 W/WindowManager( 530): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8412)
04-16 22:07:12.687 W/WindowManager( 530): at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8403)
04-16 22:07:12.687 W/WindowManager( 530): at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:1113)
04-16 22:07:12.687 W/WindowManager( 530): at android.os.BinderProxy.sendDeathNotice(Binder.java:551)
04-16 22:07:12.687 I/WindowState( 530): WIN DEATH: null