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 virtual method 'char[] java.lang.String.toCharArray()' on a null object reference #795

Closed
xwartz opened this issue Apr 14, 2017 · 6 comments

Comments

@xwartz
Copy link

xwartz commented Apr 14, 2017

Description

This crash happens on Android, but we do not have the relevant equipment, only have the Fabric crash log.

Reproduction

Fabric logs:

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.consenlabs.token/org.consenlabs.token.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2464)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
       at android.app.ActivityThread.access$900(ActivityThread.java:154)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:234)
       at android.app.ActivityThread.main(ActivityThread.java:5526)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'char[] java.lang.String.toCharArray()' on a null object reference
       at java.io.File.fixSlashes(File.java:183)
       at java.io.File.(File.java:130)
       at com.microsoft.codepush.react.FileUtils.deleteDirectoryAtPath(FileUtils.java:58)
       at com.microsoft.codepush.react.CodePushUpdateManager.rollbackPackage(CodePushUpdateManager.java:292)
       at com.microsoft.codepush.react.CodePush.rollbackPackage(CodePush.java:259)
       at com.microsoft.codepush.react.CodePush.initializeUpdateAfterRestart(CodePush.java:218)
       at com.microsoft.codepush.react.CodePush.(CodePush.java:76)
       at org.consenlabs.token.MainApplication$1.getPackages(MainApplication.java:70)
       at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:74)
       at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
       at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:102)
       at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:91)
       at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:54)
       at org.consenlabs.token.MainActivity.onCreate(MainActivity.java:38)
       at android.app.Activity.performCreate(Activity.java:6285)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2524)
       at android.app.ActivityThread.access$900(ActivityThread.java:154)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1391)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:234)
       at android.app.ActivityThread.main(ActivityThread.java:5526)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Additional Information

  • react-native-code-push version: 1.15.0-beta
  • react-native version: 0.37.0
  • Android: Xiaomi/Galaxy S7 Edge/Galaxy J5/Xperia Z5 Premium Dual/
  • Operating Systems: 5/6/7
  • Does this reproduce on a debug build or release build? release
  • Does this reproduce on a simulator, or only on a physical device? Not sure
@sergey-akhalkov
Copy link
Contributor

sergey-akhalkov commented Apr 17, 2017

Hello @xwartz, thank you for reaching us. It's really strange, we have not seen this issue before. Please let me know if you have any ideas that could help me to reproduce the issue.

@sergey-akhalkov
Copy link
Contributor

@xwartz, just a friendly ping.

@xwartz
Copy link
Author

xwartz commented Apr 24, 2017

@sergey-akhalkov
Hi, I can not reproduce this issue, only occurs on some device.

@sergey-akhalkov
Copy link
Contributor

@xwartz, I also have not reproduced the issue, but due to you are using react-native-code-push having version 1.15.0-beta I would recommend you to upgrade it to 1.15.1-beta, because that release contains fix for similar issue:

Fix a comparison check on Android that could cause an issue in the bundle loading behavior on some devices. We highly recommend upgrading to this version if you were previously on react-native-code-push@1.15.0-beta. (@Swordsman-Inaction)

So I'm closing this for now, please feel free to reopen, we'll also reopen it in case the issue will have place again and more info will be available (app source codes, repro steps and etc.).

@ravi5955
Copy link

ravi5955 commented Aug 1, 2017

@sergey-akhalkov it occurs always on redmi 4

@sergey-akhalkov
Copy link
Contributor

Hi @ravi5955, thanks for reaching us. The issue has been fixed in v2.1.0 - also take a look at #870. So could you please try to upgrade your version of react-native-code-push and verify if the issue is still reproduced?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants