Skip to content

App keeps on crashing when performUpdate is called. #83

@Tushar200018

Description

@Tushar200018

My apkVersionUrl (json file) and fileProviderAuthority is correct. The app has current version 40.9.9, there is new version available (41.1.1). So, as expected, app shows a popup saying new version available, Do you want to upgrade. When I click on yes, the app crashes. The apk works fine when I manually download the latest version. Can someone help here?
Below is the Updater code

const updater = new UpdateAPK.UpdateAPK({
      // random number are generated to get updated config each time
      apkVersionUrl,
      fileProviderAuthority: config.packageName + ".provider",
      apkVersionOptions: { method: "GET" },

      // This callback is called if there is a new version but it is not a forceUpdate.
      needUpdateApp: (performUpdate: (arg: boolean) => void) => {
        showDialog(
          <Confirmation
            message={"Update available. \nDo you want to upgrade? "}
            onProceed={() => performUpdate(true)}
          />
        );
      },

      downloadApkProgress: (progress: number) => {
        setState((prev) => ({ ...prev, downloadProgress: progress }));
      },

      // This is called if the fetch of the version or the APK fails, so should be generic
      onError: (err: { message: string }) => {
        showDialog(
          <ErrorDialog message={`There was an error, ${err.message}`} />
        );
      },
    });

logcat

07-07 18:14:39.365  1663  3022 D OemPaidWifiNetworkFactory: got request NetworkRequest [ REQUEST id=284754, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10630 RequestorUid: 10630 RequestorPkg: com.stackbox.warehouseautomation.nestlestaging UnderlyingNetworks: Null] ]
07-07 18:14:39.368  1663  2147 I WindowStateExtImpl: onSurfaceShowChange show = false mPackageName = com.stackbox.warehouseautomation.nestlestaging parentPkgName = com.stackbox.warehouseautomation.nestlestaging
07-07 18:14:39.375  1338  1338 D Layer   : reparent to null sequence=213917, seq[4], name=Splash Screen com.stackbox.warehouseautomation.nestlestaging#0
07-07 18:14:39.383  1338  1338 D Layer   : reparent to null sequence=213916, seq[3], name=db7468e Splash Screen com.stackbox.warehouseautomation.nestlestaging#0
07-07 18:14:39.383  1338  1338 D Layer   : reparent to null sequence=213928, seq[40], name=Surface(name=db7468e Splash Screen com.stackbox.warehouseautomation.nestlestaging)/@0xfc968ef - animation-leash of window_animation#0
07-07 18:14:39.384  1338  1338 D OplusLayer: ~Layer() sequence=213917, name=Splash Screen com.stackbox.warehouseautomation.nestlestaging#0 0xb40000778d06cc00
07-07 18:14:39.384  1338  1338 D OplusLayer: ~Layer() sequence=213928, name=Surface(name=db7468e Splash Screen com.stackbox.warehouseautomation.nestlestaging)/@0xfc968ef - animation-leash of window_animation#0 0xb40000778d596500
07-07 18:14:39.384  1338  1338 D OplusLayer: ~Layer() sequence=213916, name=db7468e Splash Screen com.stackbox.warehouseautomation.nestlestaging#0 0xb40000778c3a6280
07-07 18:14:39.395 15640 15778 D nativeloader: Load /data/app/~~2ih3XdS85fxcguVtKHFfYw==/com.stackbox.warehouseautomation.nestlestaging-yHHyHeZ1J6Vpe0iK9zCIyg==/lib/arm64/libimagepipeline.so using ns clns-4 from class loader (caller=/data/app/~~2ih3XdS85fxcguVtKHFfYw==/com.stackbox.warehouseautomation.nestlestaging-yHHyHeZ1J6Vpe0iK9zCIyg==/base.apk!classes2.dex): ok
07-07 18:14:41.013 15640 15640 I Quality : Skipped: false 1 cost 8.695065 refreshRate 0 processName com.stackbox.warehouseautomation.nestlestaging
07-07 18:14:41.996 15640 15640 I Quality : Skipped: true 1 cost 8.691322 refreshRate 0 processName com.stackbox.warehouseautomation.nestlestaging
07-07 18:14:42.041 15640 15640 I Quality : Skipped: true 2 cost 20.659773 refreshRate 0 processName com.stackbox.warehouseautomation.nestlestaging
07-07 18:14:42.215 15640 15640 E AndroidRuntime: Process: com.stackbox.warehouseautomation.nestlestaging, PID: 15640
07-07 18:14:42.362  1663  3673 D OplusAppStartupMonitor:     at anonymous (JavaScript:1:704), exceptionClass=com.facebook.jni.CppException, packageName=com.stackbox.warehouseautomation.nestlestaging, unstable_restrict_switch=true}]
07-07 18:14:42.366  1663  4817 W ActivityTaskManager:   Force finishing activity com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity
07-07 18:14:42.368  1663  4817 V WindowManager: Changing focus from Window{5bf8bb1 u0 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity} to null,diplayid=0
07-07 18:14:42.368  1663  4817 D CompactWindowManagerService: notifyCompactWindowState task: Task{deae324 #59847 type=standard A=10630:com.stackbox.warehouseautomation.nestlestaging U=0 visible=false mode=fullscreen translucent=true sz=1}; hasFocus: false
07-07 18:14:42.368  1663  4817 V OplusZoomWindowManagerService: prepareZoomTransition: curStack=Task{deae324 #59847 type=standard A=10630:com.stackbox.warehouseautomation.nestlestaging U=0 visible=false mode=fullscreen translucent=true sz=1}   nextStackTask{324dd9b #1 type=undefined ?? U=0 visible=true mode=fullscreen translucent=true sz=1}
07-07 18:14:42.377  3299  3316 D abnormalUtils: com.stackbox.warehouseautomation.nestlestaging is foreground =true
07-07 18:14:42.436  1663  3056 D ConnectivityService: releasing NetworkRequest [ REQUEST id=284752, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10630 RequestorUid: 10630 RequestorPkg: com.stackbox.warehouseautomation.nestlestaging UnderlyingNetworks: Null] ] (release request)
07-07 18:14:42.436  1663 10225 I WindowManager: WIN DEATH: Window{5bf8bb1 u0 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity}
07-07 18:14:42.436  1663 10225 W InputManager-JNI: Input channel object '5bf8bb1 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity (client)' was disposed without first being removed with the input manager!
07-07 18:14:42.437  1663  3056 D ConnectivityService: releasing NetworkRequest [ REQUEST id=284754, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10630 RequestorUid: 10630 RequestorPkg: com.stackbox.warehouseautomation.nestlestaging UnderlyingNetworks: Null] ] (release request)
07-07 18:14:42.437  1663  3056 D ConnectivityService: releasing NetworkRequest [ REQUEST id=284750, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10630 RequestorUid: 10630 RequestorPkg: com.stackbox.warehouseautomation.nestlestaging UnderlyingNetworks: Null] ] (release request)
07-07 18:14:42.442  1338  1338 D Layer   : reparent to null sequence=213924, seq[5], name=com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity#0
07-07 18:14:42.443  1338  1338 D OplusLayer: ~Layer() sequence=213924, name=com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity#0 0xb40000778d4c5680
07-07 18:14:42.450  1338  1338 D Layer   : reparent to null sequence=213923, seq[5], name=5bf8bb1 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity#0
07-07 18:14:42.450  1338  1338 D OplusLayer: ~Layer() sequence=213923, name=5bf8bb1 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity#0 0xb40000778d4309c0
07-07 18:14:42.452  1663  5410 D TheiaManager: KEY:packageNameVALUE:com.stackbox.warehouseautomation.nestlestaging
07-07 18:14:42.452  1663  5410 D TheiaCrashMonitor: com.stackbox.warehouseautomation.nestlestagingcrash
07-07 18:14:42.452  1663  5410 I ActivityManager: Process com.stackbox.warehouseautomation.nestlestaging (pid 15640) has died: prcp TOP 
07-07 18:14:42.458  1663  3847 I OplusHansManager : onUidGone(), 10630 com.stackbox.warehouseautomation.nestlestaging exit SM
07-07 18:14:42.460  1663  5410 V OplusZoomWindowManagerService: onAnimationFinished:  r = ActivityRecord{474c778 u0 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity t59847 f}}
07-07 18:14:42.463  1663  5410 I OplusScreenSecurityMask: onStackRemoved task = Task{deae324 #59847 type=standard A=10630:com.stackbox.warehouseautomation.nestlestaging U=0 visible=false mode=fullscreen translucent=true sz=0} record = null displayId = 0
07-07 18:14:42.463  1663  5410 D OplusAlwaysAliveManager: removing: 59847, ComponentInfo{com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity}
07-07 18:14:42.464  1663  5410 D TaskExtImpl: remove ActivityRecord{474c778 u0 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity t-1 f}} to mActivityRecordSum = Counter{ }
07-07 18:14:42.465  1663  5410 I OplusHansManager : front pkg: com.android.launcher, uid: 10176, prev pkg: com.stackbox.warehouseautomation.nestlestaging, prev uid: 10630
07-07 18:14:42.467  1663  3733 I OplusResourcePreloadManager: resume pkg: com.android.launcher, uid:10176, prev pkg: com.stackbox.warehouseautomation.nestlestaging, prev uid: 10630
07-07 18:14:42.483  1338  1338 D Layer   : reparent to null sequence=213915, seq[4], name=ActivityRecord{474c778 u0 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity#0
07-07 18:14:42.484  1338  1338 D OplusLayer: ~Layer() sequence=213915, name=ActivityRecord{474c778 u0 com.stackbox.warehouseautomation.nestlestaging/com.stackbox.warehouseautomation.MainActivity#0 0xb40000778d44a000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions