PomepuyN / discreet-app-rate

A lightweight non intrusive app rate reminder for Android
http://nicolaspomepuy.fr/non-intrusive-app-rate
Apache License 2.0
464 stars 51 forks source link

TransactionTooLargeException in "isGooglePlayInstalled" #34

Open ertanden opened 9 years ago

ertanden commented 9 years ago

I have lots of crash reports about "TransactionTooLargeException" in the method isGooglePlayInstalled.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.goseet.VidTrim/com.goseet.VidTrim.VideoDetails}: java.lang.RuntimeException: Package manager has died
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2245)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
       at android.app.ActivityThread.access$700(ActivityThread.java:150)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:5283)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.RuntimeException: Package manager has died
       at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:99)
       at fr.nicolaspomepuy.discreetapprate.Utils.isGooglePlayInstalled(Utils.java:69)
       at fr.nicolaspomepuy.discreetapprate.AppRate.checkAndShow(AppRate.java:294)
       at com.goseet.VidTrim.VideoDetails.setupActivity(VideoDetails.java:168)
       at com.goseet.VidTrim.VideoDetails.onCreate(VideoDetails.java:73)
       at android.app.Activity.performCreate(Activity.java:5283)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
       at android.app.ActivityThread.access$700(ActivityThread.java:150)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:5283)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: android.os.TransactionTooLargeException
       at android.os.BinderProxy.transact(Binder.java)
       at android.content.pm.IPackageManager$Stub$Proxy.getPackageInfo(IPackageManager.java:1612)
       at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:94)
       at fr.nicolaspomepuy.discreetapprate.Utils.isGooglePlayInstalled(Utils.java:69)
       at fr.nicolaspomepuy.discreetapprate.AppRate.checkAndShow(AppRate.java:294)
       at com.goseet.VidTrim.VideoDetails.setupActivity(VideoDetails.java:168)
       at com.goseet.VidTrim.VideoDetails.onCreate(VideoDetails.java:73)
       at android.app.Activity.performCreate(Activity.java:5283)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
       at android.app.ActivityThread.access$700(ActivityThread.java:150)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:5283)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
       at dalvik.system.NativeStart.main(NativeStart.java)
PomepuyN commented 9 years ago

According to what I've read, this is due to the 1Mb limit that is being reached by the activity listing. http://stackoverflow.com/questions/24253976/android-package-manager-has-died-with-transactiontoolargeexception

Does it happen for multiple users or just one?

ertanden commented 9 years ago

Multiple users.

Should be easy to fix with a try catch. If it gives exception, you can assume there's no play store.

ertanden commented 9 years ago

Any updates on this?

ertanden commented 9 years ago

Check pull request #38