infinitered / infinitered/react-native-mlkit
[Android] Call to function 'RNMLKitDocumentScanner.launchDocumentScannerAsync' has been rejected
- Dominant language
- TypeScript
- Stars
- 444
- Forks
- 32
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
There is a native issue sometime with some device. I tracked this error using Sentry and stack trace is the following:
```
Call to function 'RNMLKitDocumentScanner.launchDocumentScannerAsync' has been rejected.
→ Caused by: java.lang.IllegalStateException: Attempting to launch an unregistered ActivityResultLauncher with contract red.infinite.reactnativemlkit.documentscanner.contracts.DocumentScannerContract@4047e64 and input DocumentScannerContractOptions(options=red.infinite.reactnativemlkit.documentscanner.RNMLKitDocumentScannerOptions@cef827d). You must ensure the ActivityResultLauncher is registered before calling launch()
```
I'm not an Android developer, so I cannot fix it. Need help please.
Contributor guide
Research direction
Start by tracing RNMLKitDocumentScanner.launchDocumentScannerAsync and the Android ActivityResultLauncher registration involved in the stack trace. Reproduce the rejected call on an affected device if possible, then verify that document-scanner launches no longer fail because the launcher is unregistered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, react-native
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100