FORUMS

General

General

ForumsGeneral
Large scale app Crash during upgrading.
sloanyang
Greetings,

We an app developers, We have a severe crash mostly taken place on LG mobile reported by Google Play .
The crash is
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication (LoadedApk.java:622)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4773)
at android.app.ActivityThread.access$1600 (ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1417)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:5530)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:733)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:623)
Caused by: java.lang.IllegalStateException:
at android.app.LoadedApk.initializeJavaContextClassLoader (LoadedApk.java:468)
at android.app.LoadedApk.makeApplication (LoadedApk.java:614)


Including but not limited in the following roms:
LG K10 LTE (m253)
LG G4 (p1)
LG K8 (mm1v)
LG X Style (k6b)

We understand the crash is basic due to a relaunch of our app's activity during upgrading.

10-11 15:08:59.931 1007 1067 W ActivityManager: android.content.pm.PackageManager$NameNotFoundException: com.cleanmaster.mguard
10-11 15:08:59.931 1007 1067 W ActivityManager: at android.app.ApplicationPackageManager.getPackageGids(ApplicationPackageManager.java:193)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3276)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3229)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3114)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked(ActivityStackSupervisor.java:1292)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStack.resumeTopActivityInnerLocked(ActivityStack.java:2121)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1640)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStackEx.resumeTopActivityLocked(ActivityStackEx.java:34)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1627)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStack.finishCurrentActivityLocked(ActivityStack.java:3084)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3013)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStack.forceStopPackageLocked(ActivityStack.java:4192)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityStackSupervisor.forceStopPackageLocked(ActivityStackSupervisor.java:2506)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityManagerService.forceStopPackageLocked(ActivityManagerService.java:6171)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityManagerService.access$500(ActivityManagerService.java:251)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.am.ActivityManagerService$MainHandler.handleMessage(ActivityManagerService.java:1553)
10-11 15:08:59.931 1007 1067 W ActivityManager: at android.os.Handler.dispatchMessage(Handler.java:102)
10-11 15:08:59.931 1007 1067 W ActivityManager: at android.os.Looper.loop(Looper.java:135)
10-11 15:08:59.931 1007 1067 W ActivityManager: at android.os.HandlerThread.run(HandlerThread.java:61)
10-11 15:08:59.931 1007 1067 W ActivityManager: at com.android.server.ServiceThread.run(ServiceThread.java:46)

Theoretically, the relauncher of any app's activity (when the PackageManager is install the app) should be ignored.
It is very easy to reproduce the bug, simply write an app that start two activity. And use adb install -r to install, you will see the bug.
Sincerely, we hope that there will be rom upgrades to fix the problem. And we are willing to cooperate on the whole fixing process.

Yours

Qi Yang
Cheetah Mobile.
Posted on 16-Oct-2017
narae0.kim

Re:Large scale app Crash during upgrading.

Hello,

Do you mean that the issue occurs only on some particular LG models?

If so, please let us know the following:
- Model name: (e.g. H815)
- SW version:
- Android version:

Thank you.


Posted on 17-Oct-2017
sloanyang

Re:Large scale app Crash during upgrading.

Hi,

Great to hear from you.
I mean this issue occurs only on LG devices. Including but not limited to:

Model name: (e.g. H815)
LG K10 LTE (m253)
LG G4 (p1)
LG K8 (mm1v)
LG X Style (k6b)
LG K10 (m216n)
LG X power (mk6p)
LG G3 (g3)
LG Stylo 2 (ph1)
LG K4 LTE (me1)
LG Tribute 5 (m1)
LG G5 (h1)
LG K4 LTE (me1ds)
LG K10 (m23g)
LG G Stylo (g4stylusn)
LG K8 V (m1v)
LG Zero (c100)

Android version:
Android 6.0
Android 5.1
Android 5.0

It is a pity I am not a user of LG mobile. I can't provide the exact software version.
We are app developers, we get this information from the google play developer's console.
Our engineers have deep understanding of your crash.
If your engineer has any problem in understanding the crash. We can help to reproduce the crash.

Yours,
Qi


Posted on 17-Oct-2017
sloanyang

Re:Large scale app Crash during upgrading.

Hi, Great to hear form you.

It is my fault not to make it clear. First of all, it is not a crash visible to user. (The crash will not pop up any window)
But you could observer the crash in the logcat.
And the logcat looks quite similar to:

The crash is
java.lang.RuntimeException:
at android.app.LoadedApk.makeApplication (LoadedApk.java:622)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:4773)
at android.app.ActivityThread.access$1600 (ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1417)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:5530)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:733)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:623)
Caused by: java.lang.IllegalStateException:
at android.app.LoadedApk.initializeJavaContextClassLoader (LoadedApk.java:468)
at android.app.LoadedApk.makeApplication (LoadedApk.java:614)



We managed to reproduce the bug in this way:
Resources:
APK:
https://play.google.com/store/apps/details?id=com.cleanmaster.mguard

Device:
on LG G3 android version 5.0

Install that apk on LG G3, start it from launcher. Lock the LG G3.
Then try to adb install -r the same package again. You will be able to observer the FATAL exception inside the logcat.
Any Please let any android framework developer join this thread, we could be able to explain the reason of the crash,
and possible ways of fixing.

Yours,
Qi


Posted on 20-Oct-2017
sloanyang

Re:Large scale app Crash during upgrading.

Yes. This problem does not taken place in Android N.

It took place in Android 6.0, Android 5.1m Android 5.0.

And for the LG G3 specific case , it is Android 5.0. (Android L). I am here to ask if there is any possibilities to generate patches for
those Android 6.0, Android 5.1m Android 5.0 devices.

There are so many of them outside.

Yours,
Qi


Posted on 20-Oct-2017