Attempt to Invoke Interface Method 'boolean com.facebook.react.brige.ReadableMap.hasKey(java.lang.String)' on a null object reference
See original GitHub issueMy code works fine on iOS, the trouble begins in Android. Whatever I do, I face this error:
This is how I invoke image picker:
uploadFile() {
ImagePicker.launchImageLibrary(null, (response) => {
console.log('Response = ', response);
Solution
You shouldn’t set option to null as it will cause the error. You better use an empty object {} instead. Adding some robustness can help other developers not to encounter this error.
react-native-cli: 2.0.1 react-native: 0.46.3 react-native-image-picker 0.26.7 Android MacOS
Issue Analytics
- State:
- Created 6 years ago
- Reactions:22
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Attemp to invoke interface method java.lang.String com ...
I faced the same error. The solution is to do a 'Fetch replacement' as the official documentation explains: Since we are not implementing ......
Read more >Attempt to invoke interface method ''android.view.MenuItem ...
MenuItem.setVisible(boolean)'' on a null object reference at org.mozilla.gecko.home.HomeFragment.onCreateContextMenu(HomeFragment.java).
Read more >com.facebook.react.bridge.ReadableMap.getString java code ...
Best Java code snippets using com.facebook.react.bridge.ReadableMap. ... getBoolean(...) return map.getBoolean(key); case String: { String value = map.
Read more >Example usage for com.facebook.react.bridge ReadableMap ...
String key = iterator.nextKey(); switch (readableMap.getType(key)) { case Null: object. · Boolean: object.put(key, readableMap. · Number: object.put(key, ...
Read more >Attempt To Invoke Interface Method Java.Lang.String Com ...
Attempt to Invoke Interface Method 'boolean com.facebook.react.brige.ReadableMap.hasKeyjava.lang.String' on a null object reference #730. Null reference errors ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same problem, please
i have bug the same. how to fix ?