question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android 11 Crash when picking document

See original GitHub issue

Question

Hi, I am having some issues with my app. Every time that a User selects a document from the document picker the application crashes with this error

java.lang.NoSuchMethodError: No virtual method getExceptionHandler()Lcom/facebook/react/bridge/JSExceptionHandler; in class Lcom/facebook/react/bridge/ReactContext; or its super classes (declaration of 'com.facebook.react.bridge.ReactContext' appears in /data/app/~~SCx97egAGsAfLGze8YO-CQ==/xxxx.xxxx.xxxx-DoHB1qByuZVWIJImkdaEFw==/base.apk!classes16.dex)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.reactnativedocumentpicker.DocumentPickerModule$ProcessDataTask.<init>(DocumentPickerModule.java:234)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.reactnativedocumentpicker.DocumentPickerModule.onShowActivityResult(DocumentPickerModule.java:218)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.reactnativedocumentpicker.DocumentPickerModule$1.onActivityResult(DocumentPickerModule.java:76)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:333)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.onActivityResult(ReactInstanceManager.java:785)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.facebook.react.ReactDelegate.onActivityResult(ReactDelegate.java:90)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:113)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:70)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.Activity.dispatchActivityResult(Activity.java:8316)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.ActivityThread.deliverResults(ActivityThread.java:5237)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5285)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2251)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:233)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:8068)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
11-22 19:30:29.269 17692 17692 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)

Does anyone know why this might be happening? Thanks!

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
dongbach69commented, Nov 23, 2022

@acollazomayer i have to change from “super(reactContext.getExceptionHandler());” to “super(reactContext);” . it works fine. Code at line 234 in DocumentPickerModule.java .

0reactions
vonovakcommented, Nov 26, 2022

Hello, I’m closing this because upon further inspection, this should not be an issue. The constructor we use is present in RN 63 https://github.com/facebook/react-native/blob/0.63-stable/ReactAndroid/src/main/java/com/facebook/react/bridge/GuardedResultAsyncTask.java

and also in latest, RN 71.

To sum it up, this should not be an issue and if it is an issue, then please open a new one and follow the issue template, thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android: apps crashes every time i try to open file manager
Hello all, I have a very big problem: If I open an app that needs to interact with my file manager, when I...
Read more >
Detect and diagnose crashes - Android Developers
An app that is written using Java or Kotlin crashes if it throws an unhandled exception, represented by the Throwable class.
Read more >
App crashes on opening of File Browser (Android 11) #30
App crashes on opening of File Browser (Android 11) #30 ... It surprises me, that there can be a case without handler for...
Read more >
App crash on file pick in android · Issue #286 - GitHub
Hi i am not able to pick file app get crashed when i select any file. I an using android device. Issue printed...
Read more >
android - After opening PDF with intent, app crashes with ...
Selecting the document works and open fine in Polaris. When now switching back, the app crashes with Unable to start activity ...MainActivity ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found