Skip to content Skip to sidebar Skip to footer

Crash While Self Updating Apk (component Class Does Not Exist)

I am working on a system application which updates itslef by downloading an apk and installing it by using PackageManager's installPackage() method. I am getting the following exce

Solution 1:

There are different ways how to update APK..Im not sure which one you are using.. I faced similar issue .. and it was due to app has multiple instances during updating.. you can make app as single instance or just be sure there are not old instances running. I hope that may help.

Solution 2:

Since JELLY_BEAN version: Calls to PackageManager.setComponentEnabledSetting will now throw an IllegalArgumentException if the given component class name does not exist in the application's manifest.

It explains why this crash happens on a large percentage of users.

Solution 3:

Sorry, I cannot confirm whether this would be of any help since I haven't tested it myself.

Maybe you can try disabling your "SomeOldReceiver" (or any other components that might be triggered by the installation of the new package) by making a call to setComponentEnabledSetting() before calling installPackage() ?

Logistically, this might require you to produce an interim version of your app (that added the setComponentEnabledSetting() call before installPackage() and should still have "SomeOldReceiver" in its manifest) to update the old version first. You can then update this version to your real updated version with "SomeOldReceiver" removed.

Post a Comment for "Crash While Self Updating Apk (component Class Does Not Exist)"