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

Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference #31599

Closed
lezinx opened this issue May 26, 2021 · 2 comments
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.

Comments

@lezinx
Copy link

lezinx commented May 26, 2021

Description

App crashes on startup only in debug mode. Release build is fine.
Device: Samsung A11, android 10.

java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
    at java.util.regex.Matcher.reset(Matcher.java:280)
    at java.util.regex.Matcher.<init>(Matcher.java:186)
    at java.util.regex.Pattern.matcher(Pattern.java:1034)
    at com.facebook.react.devsupport.BundleDownloader$1.onResponse(BundleDownloader.java:144)
    at okhttp3.RealCall$AsyncCall.execute(RealCall.java:203)
    at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)

React Native version:

System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 296.55 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 15.12.0 - ~/.nvm/versions/node/v15.12.0/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.6.3 - ~/.nvm/versions/node/v15.12.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /Users/z.ledai/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.3
System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_222 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. npx react-native init AwesomeProject
  2. npx react-native run-android
@lezinx lezinx changed the title Build app crash in android debug mode Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference May 27, 2021
@lezinx lezinx closed this as completed May 28, 2021
@luskin
Copy link

luskin commented Sep 9, 2021

@lezinx what was the reason for this? We are experiencing the same

@lezinx
Copy link
Author

lezinx commented Sep 9, 2021

@lezinx what was the reason for this? We are experiencing the same

Check if port is used by other program and if it used kill it. Run lsof -i :8081 in terminal to check

@facebook facebook locked as resolved and limited conversation to collaborators May 28, 2022
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants