Discussion:
getInstalledPackages(PackageManager.GET_ACTIVITIES) -> PackageManager has died!?
3c
2012-04-25 05:12:46 UTC
Permalink
Here is a crash report I received today while my app runs:
pm.getInstalledPackages(PackageManager.GET_ACTIVITIES);
Can someone tell me how to resolve this? This call used to have the flag
set to 0 without issues, but now one (maybe more) of my users is receiving
this error preventing the use of my app! :( Couldn't find any info on this
on the net!!! And can't contact the user who sent the FC report.

Caused by: java.lang.RuntimeException: Package manager has died
at
android.app.ApplicationPackageManager.getInstalledPackages(ApplicationPackageManager.java:400)
at
ccc71.pmw.lib.pmw_icon_package_list.onResume(pmw_icon_package_list.java:68)
at ccc71.pmw.pmw_icon_package_list.onResume(pmw_icon_package_list.java:12)
at
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1154)
at android.app.Activity.performResume(Activity.java:4539)
at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2434)
... 12 more
Caused by: android.os.TransactionTooLargeException
at android.os.BinderProxy.transact(Native Method)
at
android.content.pm.IPackageManager$Stub$Proxy.getInstalledPackages(IPackageManager.java:1900)
at
android.app.ApplicationPackageManager.getInstalledPackages(ApplicationPackageManager.java:394)
... 17 more
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Mark Murphy
2012-04-25 11:09:55 UTC
Permalink
Post by 3c
pm.getInstalledPackages(PackageManager.GET_ACTIVITIES);
Can someone tell me how to resolve this?
My interpretation of the crash is that either:

-- The user has too many applications installed, such that the list of
installed packages with the activity data exceeds 1MB, or
-- The user is running some flawed firmware

I do not see how you can recover from either scenario.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
3c
2012-04-25 19:06:26 UTC
Permalink
Well, I reverted the call to getInstalledPackages(0);

Then manually retrieved the activity I was interested in, as I knew in
advance which one to look for.

A flawed firmware why not, but just exceeding 1MB of activity data seems
unreasonable? My kids have installed 300+ games on their tablets and
there's still like 70% free space! Though not such issue on those tablets.
So 1MB of activity data would mean how many apps installed, any rough idea?

Thanks for your prompt reply.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Mark Murphy
2012-04-25 19:09:35 UTC
Permalink
Post by 3c
A flawed firmware why not, but just exceeding 1MB of activity data seems
unreasonable? My kids have installed 300+ games on their tablets and there's
still like 70% free space! Though not such issue on those tablets. So 1MB of
activity data would mean how many apps installed, any rough idea?
Beats me. I have never tried counting bytes of getInstalledPackages()
output. The 1MB limit is a known barrier on IPC transactions.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Dianne Hackborn
2012-04-25 21:23:45 UTC
Permalink
Why are you doing this? This is a terrible way to find out about an
activity.

What are you actually trying to do? Usually people use
PackageManager.getIntentActivities() to get the set of activities they are
interested in.
Post by 3c
Well, I reverted the call to getInstalledPackages(0);
Then manually retrieved the activity I was interested in, as I knew in
advance which one to look for.
A flawed firmware why not, but just exceeding 1MB of activity data seems
unreasonable? My kids have installed 300+ games on their tablets and
there's still like 70% free space! Though not such issue on those tablets.
So 1MB of activity data would mean how many apps installed, any rough idea?
Thanks for your prompt reply.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--
Dianne Hackborn
Android framework engineer
***@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. All such
questions should be posted on public forums, where I and others can see and
answer them.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Cedric Counotte
2012-04-25 21:37:03 UTC
Permalink
Why am I doing what ? getInstalledPackages(0), because I'm interested in
specific package names with a predefined prefix, those may include a
specific activity to configure the package.



All the packages I'm looking for are app extension that I develop myself. So
using getIntentActivities() is of no interest in this situation.



In other words I'm searching for packages with predefined named (eg
<prefix>.name) and then out of those I need to know which one have an
activity named "settings".



Now the getInstalledPackages(PackageManager.GET_ACTIVITIES) is a valid API
call, and nothing in the documentation says not to use it, but nevertheless
it doesn't seem to be a good idea.



Some users got FCs while others didn't get any results out of it.



From: android-***@googlegroups.com
[mailto:android-***@googlegroups.com] On Behalf Of Dianne Hackborn
Sent: mercredi 25 avril 2012 23:24
To: android-***@googlegroups.com
Subject: Re: [android-developers]
getInstalledPackages(PackageManager.GET_ACTIVITIES) -> PackageManager has
died!?



Why are you doing this? This is a terrible way to find out about an
activity.



What are you actually trying to do? Usually people use
PackageManager.getIntentActivities() to get the set of activities they are
interested in.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-***@googlegroups.com
To unsubscribe from this group, send email to
android-developers+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
Loading...