在应用程序中获取JNI检测到的错误:在将输出层添加到DNN时,调用JNI CallIntMethodV并带有未决异常

时间:2019-02-25 13:41:38

标签: android kotlin android-ndk ndk-build

2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470] JNI DETECTED ERROR IN APPLICATION: JNI CallIntMethodV called with pending exception java.lang.NoSuchMethodError: no non-static method "Ljava/util/ArrayList;.get((I)Ljava/lang/Object;"
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void org.opencv.dnn.Net.forward_4(long, long, java.util.List) (Net.java:-2)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void org.opencv.dnn.Net.forward(java.util.List, java.util.List) (Net.java:334)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void com.example.mlkitdemoapp.MainActivity.detectTextBlocks(android.graphics.Bitmap) (MainActivity.kt:171)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void com.example.mlkitdemoapp.MainActivity.onSelectFromGalleryResult(android.content.Intent) (MainActivity.kt:119)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void com.example.mlkitdemoapp.MainActivity.onActivityResult(int, int, android.content.Intent) (MainActivity.kt:266)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.app.Activity.dispatchActivityResult(java.lang.String, int, int, android.content.Intent) (Activity.java:6931)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.app.ActivityThread.deliverResults(android.app.ActivityThread$ActivityClientRecord, java.util.List) (ActivityThread.java:4090)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.app.ActivityThread.handleSendResult(android.app.ActivityThread$ResultData) (ActivityThread.java:4137)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.app.ActivityThread.-wrap20(android.app.ActivityThread, android.app.ActivityThread$ResultData) (ActivityThread.java:-1)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1529)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.os.Looper.loop() (Looper.java:154)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6123)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:867)
2019-02-25 18:59:14.305 1621-1621/com.example.mlkitdemoapp A/art: art/runtime/java_vm_ext.cc:470]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:757)

Java代码

val net = readNetFromTensorflow(modelPath)


        val outputLayers = listOf("feature_fusion/Conv_7/Sigmoid", "feature_fusion/concat_3")

        net.setInput(blob)

        val output = ArrayList<Mat>()

        net.forward(output, outputLayers)

按照上面的代码中提到的,我试图通过将2个输出层应用于DNN模型的转发方法来获取得分和几何图形作为输出。但是我得到这个错误。请如果您知道任何相关的信息。帮帮我。

0 个答案:

没有答案