Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
This repository was archived by the owner on May 20, 2025. It is now read-only.

An error occurred while executing doInBackground(), Caused by java.lang.NullPointerException com.microsoft.codepush.react.FileUtils.copyDirectoryContents #2087

@natioskar

Description

@natioskar

Steps to Reproduce

I wasn't able to reproduce it myself due to lack of this kind of device, but according to the Crashlytics & Sentry stack trace its only happening on Huawei P30 lite right after the code push update check (with no new pending updates)

Expected Behavior

Just normal update check and continue app loading, with the result of no new update

Actual Behavior

App crashed with the following -

Fatal Exception: java.lang.RuntimeException
An error occurred while executing doInBackground()
    android.os.AsyncTask$4.done (AsyncTask.java:399)
    java.lang.Thread.run (Thread.java:929)
java.io.File.<init> (File.java:283)
com.microsoft.codepush.react.FileUtils.copyDirectoryContents (FileUtils.java:19)
com.microsoft.codepush.react.CodePushUpdateUtils.copyNecessaryFilesFromCurrentPackage (CodePushUpdateUtils.java:100)
com.microsoft.codepush.react.CodePushUpdateManager.downloadPackage (CodePushUpdateManager.java:242)
com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground (CodePushNativeModule.java:290)
com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground (CodePushNativeModule.java:284)
android.os.AsyncTask$3.call (AsyncTask.java:378)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
java.lang.Thread.run (Thread.java:929)

Reproducible Demo

I don't have a reproducible Demo, but the way I use code push -

CodePush({
  checkFrequency: CodePush.CheckFrequency.ON_APP_RESUME,
  installMode: CodePush.InstallMode.ON_NEXT_RESUME,
})

Environment

  • react-native-code-push version: 7.0.1
  • react-native version: 0.64.0
  • iOS/Android/Windows version: Android 10
  • Does this reproduce on a debug build or release build? release
  • Does this reproduce on a simulator, or only on a physical device? physical device - Huawei P30 lite

Sorry for the lack of reproducible demo and more specific steps, this only started when we rolled out to production

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions