General (Read-only)

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
jeongeun.jeon

Re:Large scale app Crash during upgrading.

Hello, sloanyang.
Thanks for the bug report.
We tried to regenerate the bug you reported, but it didn't occur. We think that we misunderstood the environment.
We reinstalled with -r option after running an activity, but it works well. (no app crash occurred)

Please tell us what we have to do before we run an activity.
In addition, you said "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. ". What does "start two activities" means?

We always welcome any ways for you contact us. Both emailing to developer@lge.com directly or leaving a message in here are okay.


Posted on 19-Oct-2017
jeongeun.jeon

Re:Large scale app Crash during upgrading.

Hello, sloanyang.
Can you send me a sample apk (empty app)?

Thank you.


Posted on 19-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
jeongeun.jeon

Re:Large scale app Crash during upgrading.

Hello, sloanyang.
Thanks for your kind explanation.

We cannot reproduce the bug you reported on G3 running on Android N.
We also additionally tested G5 and V10 (even if they aren't running on the reported Android versions), but we didn't find such error messages.
We suppose that there may be another factor to generate that bug.

Regards,
Jeon


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
jeongeun.jeon

Re:Large scale app Crash during upgrading.

Hello, sloanyang.
Sorry for giving you unclear information. We tested on V30 (Android N) and G3 (Andorid M), then both devices didn't make the error.

Do you mean it won't be occurred on Android M and it only occurs on Android L if the device is G3? Then I'm afraid we get a problem to have the test device.
It is difficult to deal with the issue because we cannot see the error occurs. I hope you to understand.

Thanks


Posted on 22-Oct-2017
Navigation