Error message: "java.lang.IllegalStateException: package not installed?"

15

Situation

I'm getting this type of error in my logcat and I do not know exactly what it can be. Although this error is not compromising the functioning of the application (so it is perceived) being compiled from Eclipse , the project still continues to run normally. This project is not in the Google Play Store , but it has a version control server. Whenever a new version of the application is generated, it automatically receives a notification stating that it has this new version to be installed.

Message

java.lang.RuntimeException: Unable to instantiate 
application android.app.Application: 
java.lang.IllegalStateException: Unable to get package info for br.com.meuapp; 
is package not installed?

Moment of error

The error appears exactly after compiling the code to generate a new .apk for reinstallation using USB Debug .

Setting the Environment

Note

In the project the INSTALL_PACKAGES permission is used in which, by default, an error message is displayed that can only be compiled if you run the project CLEAN .

<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
  

Permission is only granted to system apps

Questions

I need these questions to be clarified about the error, as some crash may happen on a device other than the test device.

What caused this error? What can happen if the error persists? How to fix this error?

    
asked by anonymous 26.08.2016 / 22:21

2 answers

0

The reason for granting INSTALL_PACKAGES permission is related to the installation of applications silently. If the application does not have "permission unknown sources" and successively does not grant INSTALL_PACKAGES permission on the manifest.xml, the application will NOT be installed. Some applications, or most of them, have a "silent" or silent "install" option known as silent install >, which is to install an application without the user or support team having to interact with that application in your installation.

  

What caused this error?

The error happens because the IDE tries to reinstall the application over the running application, when in fact this initiative would have to start from a routine inside the app.

  

What can happen if the error persists?

There will only be some kind of problem if the .apk found in the versioning server is not signed with the same key. This will not install the application.

  

How to fix this error?

As I said in the above response, there will not be an error if the application has the same key.

    
17.12.2016 / 02:53
1

This error is common with the version of Android (api 10). Error Code Google Code

From what I saw in the "Global" StackOverflow this error does not change anything in relation to your application as was said by you above. But there is a solution that is to try to uninstall the apk and install it again.

Another option is if you can change the development api.

The fact is that it has nothing to do with the code / IDE, but a possible bug in the version used.

    
19.09.2016 / 20:48