medyo / android-about-page

Create an awesome About Page for your Android App in 2 minutes
2.04k stars 281 forks source link

IsAppInstalled -> Packagemanager has died #119

Closed landliebe closed 5 years ago

landliebe commented 6 years ago

On some devices the about page crashes. And if it crashes on a device, this is not a one time thing: At those devices it crashes constantly.

Fatal Exception: java.lang.RuntimeException Unable to resume activity {xxx}: java.lang.RuntimeException: Package manager has died android.app.ActivityThread.performResumeActivity (ActivityThread.java:4225) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

android.app.ApplicationPackageManager.getPackageInfo (ApplicationPackageManager.java:258) mehdi.sakout.aboutpage.AboutPageUtils.isAppInstalled (AboutPageUtils.java:14) mehdi.sakout.aboutpage.AboutPage.addFacebook (AboutPage.java:137) mehdi.sakout.aboutpage.AboutPage.addFacebook (AboutPage.java:115) xxx.FragmentAbout.onCreateView (FragmentAbout.java:57)

Maybe this has something to do with: https://stackoverflow.com/questions/24253976/android-package-manager-has-died-with-transactiontoolargeexception

So maybe those users where it crashes have installed a lot of packages and therefor the limit hits?

karmil32 commented 5 years ago

I got the same issue

vinit-poojary commented 5 years ago

I am having same problem but when i removed .addFacebook("aboutfb") it started working fine .it works fine in api 27 issue comes when i run in api 23 thats when i removed .addFacebook("")

used additem("");

this bug should be solved soon

geecko86 commented 5 years ago

I'm seeing this crash report too on devices running API 21-23.

ETA on a fix?

tomi44g commented 5 years ago

Even though I cannot reproduce it on my device I am getting crash reports for this as well. Since the isAppInstalled is not interested in the list of activities perhaps it could be fixed by replacing getPackageInfo with getInstalledPackages like here: https://github.com/PomepuyN/discreet-app-rate/pull/38/commits/7271190bbc58ee5fe1d850ce4103d38f9d02b369

geecko86 commented 5 years ago

This repo appears to fix it: https://github.com/munix/android-about-page

Given that @medyo doesn't appear to be maintaining this library anymore, I replaced the dependency in my build.gradle file.

medyo commented 5 years ago

Hi guys,

Sorry for being offline lately, I just fixed the issue using @tomi44g code, please refer to: https://github.com/medyo/android-about-page/commit/e88e3a4dad759a4d2da7aa848cb6ddca56f03b3d