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

NullPointerException in FileUtils.copyDirectoryContents #1584

Closed
Tracked by #2760
maxhawkins opened this issue May 10, 2019 · 14 comments
Closed
Tracked by #2760

NullPointerException in FileUtils.copyDirectoryContents #1584

maxhawkins opened this issue May 10, 2019 · 14 comments

Comments

@maxhawkins
Copy link

maxhawkins commented May 10, 2019

Steps to Reproduce

  1. Call CodePush.checkForUpdate()
  2. Call update.download()

Expected Behavior

Update downloads successfully.

Actual Behavior

java.lang.NullPointerException: Attempt to get length of null array
    at com.microsoft.codepush.react.FileUtils.copyDirectoryContents(FileUtils.java:25)
    at com.microsoft.codepush.react.CodePushUpdateManager.downloadPackage(CodePushUpdateManager.java:233)
    at com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:216)
    at com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:210)
    at android.os.AsyncTask$2.call(AsyncTask.java:333)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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:764)

Environment

Captured by Sentry in production.

  • react-native-code-push version: 2.0.6
  • react-native version: 0.59.5
  • iOS/Android/Windows version: Android 9, Android 8.1.0
  • Does this reproduce on a debug build or release build? Release

One device that repeatedly triggered the crash had low disk space. This could be related.

@maxhawkins
Copy link
Author

Seems there's a missing exists() check here which causes the crash, but the missing source directory indicates a deeper problem.

@yuri-kulikov
Copy link
Contributor

Hey @maxhawkins,
Thanks for reporting!

One device that repeatedly triggered the crash had low disk space. This could be related.

Could you please clarify what device is it? Just in case.

react-native-code-push version: 2.0.6

Sorry, could you double-check that?

Seems there's a missing exists() check here which causes the crash, but the missing source directory indicates a deeper problem.

Sound reasonable. We'll try to reproduce the problem and see if it's caused by missing source directory or something else.

@maxhawkins
Copy link
Author

Double-checked. It's actually

I saw this error on a Pixel 2 and a Moto G

@henrymoulton
Copy link

Crashlytics is seeing this:

  • HUAWEI P smart 2019 -- 50%
  • Mate 20 Pro --36%

@henrymoulton
Copy link

@yuri-kulikov Again it's all Android devices, in #1505 you mention "these Huawei devices may have an unusual memory configuration", is there anything we can do here?

@andreidubov
Copy link
Contributor

@maxhawkins
Hello and sorry for the delay.

Unfortunately, I could not reproduce this issue, could you clarify whether you continue to encounter it?

@andreidubov
Copy link
Contributor

Hi @maxhawkins

Unfortunately, I'm going to close this issue for now as I haven't heard from you in a while.
Please feel free to reopen this issue if you have questions.

@premhowli
Copy link

premhowli commented Sep 18, 2023

Seeing this issue in vivo, oppo, samsung, xiaomi. using 8.1.0 version.

@HimanshuNarang
Copy link

Facing the same issue on multiple android devices.

@DesHenaghen
Copy link

We have now in the last few days seen this error on 3 different Android devices: Oppo A54, Moto G22 & Galaxy Tab A7. Was there any resolution to the issue?

@himanshuzeptonow
Copy link

Facing same issue from last couple of days

@Piousangel
Copy link

Is the problem solved? or my fault?

@DmitriyKirakosyan
Copy link
Contributor

Anyone still facing this issue on the latest version of react-native-code-push? If so, please share your crash logs.

@miridih-chyoon
Copy link

miridih-chyoon commented Sep 18, 2024

Reopen #2760

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