Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminating with uncaught exception of type jni::PendingJavaException #354

Closed
GULERTOLGA opened this issue Jul 10, 2020 · 7 comments
Closed

Comments

@GULERTOLGA
Copy link
Contributor

I sometimes encounter this error and the application closes. I do not know how to reproduce. I get feedback from customers that the app is suddenly closed while navigating the map.

Mapbox 0.7.0

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.4 19E287, locale en-TR)
• Flutter version 1.17.5 at /Users/tolgaguler/flutter
• Framework revision 8af6b2f038 (10 days ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/tolgaguler/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4

[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[!] IntelliJ IDEA Community Edition (version 2020.1.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.46.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0

[✓] Connected device (2 available)
• Mi A3 • 53f8cafbc337 • android-arm64 • Android 10 (API 29)
• tolga.guler iPhone’u • 960b7e89314ea5dc0d5a52f7258defda22aabf7d • ios • iOS 13.3.1

@GULERTOLGA
Copy link
Contributor Author

GULERTOLGA commented Jul 13, 2020

uid: 10191
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'terminating with uncaught exception of type jni::PendingJavaException'
    x0  0000000000000000  x1  00000000000051dd  x2  0000000000000006  x3  0000007ffd147e20
    x4  61c8ff6d6e68736f  x5  61c8ff6d6e68736f  x6  61c8ff6d6e68736f  x7  7fff7f7f7f7f7f7f
    x8  00000000000000f0  x9  62ca946b5f751184  x10 0000000000000001  x11 0000000000000000
    x12 fffffff0fffffbdf  x13 656378456176614a  x14 0000007555f3aef0  x15 0000000000000000
    x16 00000076721858c0  x17 0000007672161900  x18 0000007674322000  x19 00000000000051dd
    x20 00000000000051dd  x21 00000000ffffffff  x22 ffffff80ffffffc8  x23 0000007ffd148070
    x24 0000007ffd147f50  x25 0000007ffd147f90  x26 0000000000000001  x27 0000000000000059
    x28 0000000000000001  x29 0000007ffd147ec0
    sp  0000007ffd147e00  lr  00000076721130c4  pc  00000076721130f0
backtrace:
      #00 pc 00000000000830f0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: cf739dbc84bcc78f7a1500721bfb3758)
      #01 pc 00000000004adebc  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #02 pc 00000000004ae02c  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #03 pc 00000000004ab4dc  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #04 pc 00000000004aabe0  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #05 pc 00000000004aab60  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (__cxa_throw+120) (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #06 pc 0000000000215858  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #07 pc 0000000000217970  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #08 pc 0000000000235e60  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (mbgl::android::NativeMapView::onStyleImageMissing(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)+116) (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #09 pc 00000000002ac8ec  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #10 pc 0000000000294460  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #11 pc 000000000035f944  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #12 pc 000000000035fa20  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #13 pc 000000000035e7c0  /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)
      #14 pc 000000000001836c  /system/lib64/libutils.so (android::Looper::pollInner(int)+832) (BuildId: 8dcc6a23d7b5c85e8562aa5394a3a42f)
      #15 pc 0000000000017f8c  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+56) (BuildId: 8dcc6a23d7b5c85e8562aa5394a3a42f)
      #16 pc 000000000013b920  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44) (BuildId: 7c435cb5dc9d1c09ad59f054febe0058)
      #17 pc 00000000002a4afc  /system/framework/arm64/boot-framework.oat (art_jni_trampoline+140) (BuildId: 97d0dbc0cdffdee1013d31c09ba87556afe29349)
      #18 pc 000000000201a87c  /memfd:/jit-cache (deleted) (android.os.MessageQueue.next+204)
      #19 pc 0000000002080388  /memfd:/jit-cache (deleted) (android.os.Looper.loop+408)
      #20 pc 000000000013663c  /apex/com.android.runtime/lib64/libart.so (art_quick_osr_stub+60) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #21 pc 00000000003370f4  /apex/com.android.runtime/lib64/libart.so (art::jit::Jit::MaybeDoOnStackReplacement(art::Thread*, art::ArtMethod*, unsigned int, int, art::JValue*)+1688) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #22 pc 00000000005aaa68  /apex/com.android.runtime/lib64/libart.so (MterpMaybeDoOnStackReplacement+212) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #23 pc 0000000000135350  /apex/com.android.runtime/lib64/libart.so (MterpHelpers+240) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #24 pc 000000000031f604  /system/framework/framework.jar (android.os.Looper.loop+1076)
      #25 pc 00000000005a2a1c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1040) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #26 pc 0000000000130994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #27 pc 000000000018c8d0  /system/framework/framework.jar (android.app.ActivityThread.main+196)
      #28 pc 00000000002b3b10  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.17460956533834400288+240) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #29 pc 0000000000591214  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #30 pc 000000000013f468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #31 pc 00000000001365b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #32 pc 000000000014500c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #33 pc 00000000004afc18  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #34 pc 00000000004b17bc  /apex/com.android.runtime/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1480) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #35 pc 000000000043cb60  /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #36 pc 00000000000c2c34  /system/framework/arm64/boot.oat (art_jni_trampoline+180) (BuildId: a0b292b21d796006255a63781b8e3067d6a82ca3)
      #37 pc 0000000000136334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #38 pc 0000000000144fec  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #39 pc 00000000002e27fc  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #40 pc 00000000002dda5c  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+892) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #41 pc 000000000059fcac  /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+648) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #42 pc 0000000000130814  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #43 pc 00000000003512ce  /system/framework/framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+22)
      #44 pc 00000000002b3b10  /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.17460956533834400288+240) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #45 pc 0000000000591214  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1032) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #46 pc 000000000013f468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #47 pc 00000000009b616c  /system/framework/arm64/boot-framework.oat (com.android.internal.os.ZygoteInit.main+2076) (BuildId: 97d0dbc0cdffdee1013d31c09ba87556afe29349)
      #48 pc 00000000001365b8  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_static_stub+568) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #49 pc 000000000014500c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+276) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #50 pc 00000000004afc18  /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #51 pc 00000000004af808  /apex/com.android.runtime/lib64/libart.so (art::InvokeWithVarArgs(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+408) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #52 pc 00000000003ba5a4  /apex/com.android.runtime/lib64/libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+624) (BuildId: 3853a2ceaeb009fc07a0847a55abcf6a)
      #53 pc 00000000000bf99c  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+116) (BuildId: 7c435cb5dc9d1c09ad59f054febe0058)
      #54 pc 00000000000c282c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+776) (BuildId: 7c435cb5dc9d1c09ad59f054febe0058)
      #55 pc 00000000000035b0  /system/bin/app_process64 (main+1376) (BuildId: b37b0ba1daa0a4dfe5092fb9afbc2648)
      #56 pc 000000000007e898  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+108) (BuildId: cf739dbc84bcc78f7a1500721bfb3758)

@GULERTOLGA
Copy link
Contributor Author

I add a marker to the map in the onStyleLoadedCallback method. I use a special style file from network and get the marker icon from the assets folder (). However, the error is not always reproduced.

#8 pc 0000000000235e60 /data/app/com.netcad.netigma-7NqLQvs5BRmX7bOYsTEzWg==/lib/arm64/libmapbox-gl.so (mbgl::android::NativeMapView::onStyleImageMissing(std::__ndk1::basic_string<char, std::__ndk1::char_traits, std::__ndk1::allocator> const&)+116) (BuildId: 1e525e74b2fbe093dde5e54f6e787b7e094bf205)

 _currentSymbol = await _controller.addSymbol(
      SymbolOptions(
          iconOffset: new Offset(0, -16),
          iconSize: 1.0,
          draggable: true,
          geometry: LatLng(
            center.latitude,
            center.longitude,
          ),
          iconImage: "assets/images/marker.png"),
    );

@m0nac0
Copy link
Collaborator

m0nac0 commented Jul 13, 2020

Sounds like it could be related to the fact that we add the onStyleImageMissingListener only after invoking flutter's onMapReady callback here: https://github.com/tobrun/flutter-mapbox-gl/blob/576d28ec69a6ff11e9e7e7e8bdd10d500f13e91c/android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java#L281-L297
We should probably try moving the onMapReady call to flutter to the end of that method, after we've actually initialized all our listeners.

@GULERTOLGA
Copy link
Contributor Author

Does it help if I load the markers from the assets folder with the mapController.addImage method first?

@m0nac0
Copy link
Collaborator

m0nac0 commented Jul 14, 2020

@GULERTOLGA It would definitely be helpful to know if that fixes the issue.

@m0nac0
Copy link
Collaborator

m0nac0 commented Aug 15, 2020

@GULERTOLGA Have you been able to find out if manually adding the image before adding the marker solves the issue?
(BTW, I edited your comment by putting the stacktrace in a code block, otherwise Github would always link to all kinds of issues in the issue tracker because the lines start with #)

@GULERTOLGA
Copy link
Contributor Author

i am not sure but i think this method solved the problem. i can no longer get error with the devices I have. I will release the new version of the application in a few days. I will review the Crashlytics reports and inform you.

@tobrun tobrun closed this as completed Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants