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.

Android crashes/rollback every time an update is applied #2615

@zgordon02

Description

@zgordon02

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

  1. I have an bare expo project, fully installed codepush and it is working fine in iOS
  2. I am using this in my index.js:
registerRootComponent(
  codePush({
    checkFrequency: codePush.CheckFrequency.ON_APP_START,
    installMode: codePush.InstallMode.IMMEDIATE,
  })(App)
);
  1. Every update attempt in Android fails, iOS has no issues.

Expected Behavior

What you expected to happen?
I expect the update to apply properly

Actual Behavior

What actually happens?
I get the following exception, the app crashes, and the update is rolled back

2023-11-08 07:41:15.055 27221-27295 ReactNative             pid-27221                            D  [CodePush] Loading JS bundle from "/data/user/0/my.app/files/CodePush/6c1f8393d90670dfdd1f924f6a413442dc672aa7cfd1c68b88a0180de478911b/CodePush/index.android.bundle"
2023-11-08 07:41:15.291  1157-2187  BiometricS...reAuthInfo pid-1157                             D  Package: my.app Sensor ID: 0 Modality: 2 Status: 1
2023-11-08 07:41:15.292  1157-2187  BiometricS...reAuthInfo pid-1157                             D  Package: my.app Sensor ID: 1 Modality: 8 Status: 4
2023-11-08 07:41:15.418 27221-27283 AndroidRuntime          pid-27221                            E  FATAL EXCEPTION: expo.modules.AsyncFunctionQueue
                                                                                                    Process: my.app, PID: 27221
                                                                                                    java.lang.NullPointerException: java.lang.NullPointerException
                                                                                                    	at expo.modules.kotlin.jni.JavaCallback.invoke(Native Method)
                                                                                                    	at expo.modules.kotlin.jni.JavaCallback.invoke(JavaCallback.kt:24)
                                                                                                    	at expo.modules.kotlin.jni.PromiseImpl.reject(PromiseImpl.kt:87)
                                                                                                    	at expo.modules.kotlin.Promise$DefaultImpls.reject(Promise.kt:15)
                                                                                                    	at expo.modules.kotlin.jni.PromiseImpl.reject(PromiseImpl.kt:26)
                                                                                                    	at expo.modules.kotlin.functions.AsyncFunction$attachToJSObject$2$functionBody$1.invoke(AsyncFunction.kt:74)
                                                                                                    	at expo.modules.kotlin.functions.AsyncFunction$attachToJSObject$2$functionBody$1.invoke(AsyncFunction.kt:66)
                                                                                                    	at expo.modules.kotlin.functions.AsyncFunction$attachToJSObject$2$3.invokeSuspend(AsyncFunction.kt:104)
                                                                                                    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                    	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:938)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:226)
                                                                                                    	at android.os.Looper.loop(Looper.java:313)
                                                                                                    	at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                                    	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [CoroutineName(expo.modules.AsyncFunctionQueue), StandaloneCoroutine{Cancelling}@6e2d82, Handler (android.os.Handler) {5532c93}]
2023-11-08 07:41:15.421  1157-2187  ActivityManager         pid-1157                             D  TMO sendAppStateMsg package=my.app pid=27221
2023-11-08 07:41:15.424  1157-2187  ActivityManager         pid-1157                             W  crash : my.app,11171
2023-11-08 07:41:15.427  1157-2187  ActivityTaskManager     pid-1157                             W    Force finishing activity my.app/my.app.MainActivity

Reproducible Demo

  • Download https://github.com/microsoft/react-native-code-push/archive/master.zip and unzip. From Examples folder run node create-app.js appName react-native@0.61.5 react-native-code-push@6.0.0 command to generate plain CodePushified React Native app. Please see description on top of create-app.js file content if needed
  • If you can't reproduce the bug on it, provide us as much info as possible about your project

Environment

  • react-native-code-push version: 8.1.0
  • react-native version: 0.72.1
  • iOS/Android/Windows version: Android 12
  • Does this reproduce on a debug build or release build? All
  • Does this reproduce on a simulator, or only on a physical device? Physical Device

(The more info the faster we will be able to address it!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions