Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
See original GitHub issueI am running the Android application with react-native run-android
. The application crashing at the entry with the following error
Attempt to invoke virtual method ‘boolean java.lang.String.equals(java.lang.Object)’ on a null object reference
Environment
Environment: OS: Windows 10 Node: 6.10.2 Yarn: 1.5.1 npm: 3.10.10 Watchman: Not Found Xcode: N/A Android Studio: Not Found
The machine does have Android Studio and Android SDK.
Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.2 react-native: 0.54.2 => 0.54.2
Expected Behavior
The application should open normally
Actual Behavior
The application is crashing with the following errors.
Steps to Reproduce
As this is a private project cannot give the code and steps to reproduce.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:13 (2 by maintainers)
Top Results From Across the Web
NullPointerException: Attempt to invoke virtual method ...
NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equalsIgnoreCase(java.lang.String)' on a null object reference ...
Read more >Attempt to invoke virtual method 'boolean java.lang.String ...
NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference #4618.
Read more >Attempt to invoke virtual method 'boolean java.lang ... - YouTube
... Attempt to invoke virtual method ' boolean java. lang. String.equalsIgnoreCase( java. lang. String )' on a null object reference [ B...
Read more >Attempt to invoke virtual method ''boolean java.lang.String ...
NullPointerException: Attempt to invoke virtual method ''boolean java.lang.String.equals(java.lang.Object)'' on a null object reference at org.mozilla.gecko.
Read more >Error from Companion: Attempt to invoke virtual method 'java ...
It said, "Error from Companion: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference" ...
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 Free
Top 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
I’ve ran into the same issue. The error message originates from
https://github.com/facebook/react-native/blob/e636eb60d7c8cff3a73183e02d9d457d32a6ec53/ReactAndroid/src/main/java/com/facebook/react/modules/blob/BlobModule.java#L81-L82
On line 81 the developer tries to extract the scheme (http/https) the request is using, but the method
uri.getScheme()
is returningnull
. That means your request has no scheme. Line 82 attempts to call a virtual method which doesn’t exist for the valuenull
.Add a scheme to your request and the problem should go away.
We should submit a PR to provide a clearer error message when the request doesn’t have a scheme.
I got same issue here, error show where I get data from API, and in log show
ReactNative: CatalystInstanceImpl.destroy() start ReactNative: CatalystInstanceImpl.destroy() end
FYI I use “react”: “16.3.0-alpha.1”, “react-native”: “0.54.2”,