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

Asked

Viewed 3,894 times

15

Situation

I’m getting this kind of mistake in mine logcat and I don’t know exactly what it could be. Although this error is not compromising the operation of the application (as far as it is perceived) being compiled from the Eclipse, the project is still running normally. This project is not 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.

Environment Settings

Observing

The permission is being used in the project INSTALL_PACKAGES which by default displays an error message that can only be compiled if you run the CLEAN of the project.

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

Permission is only granted to system apps

Doubts

I need these doubts to be clarified in relation to the error, because it can happen some crash in another device that is not the test.

What is the cause of this error? What can happen if the error persists? How to fix this error?

  • It already happened to me, and I decided to go on Build/Clean Project, so IDE realoca everything in its proper place.

  • @Leonardodias Did you do this in Android Studio? I use Eclipse, which in this case would be equivalent Project/Clean... but does not solve the problem! It happens exactly when the application is open using USB Debug, then I run to install again. Then logcat shows the error message.

  • Are you even facing this problem or copied the question from here?

  • @ramaral if I say it’s the two options you believe? Well, when I ask a question, the normal is to do a search. I found some things that did not convince me in the understanding. So I made the debt two others to mine too. But in short, I am really with this problem. However as it is not affecting my project, I decided to have a little more patience.

  • Yes I do. Is there anything else you can add to the question? Do you have any suspicion of what it might be?

  • 2

    @ramaral I edited the question by inserting the Moment of error. I don’t have much more detail at hand.

  • 1

    @I improved the text to better understand the issue. From what I understand, maybe it has something to do with the version control of the application. But I’m not sure! So I’m still doing research to solve the problem so I don’t have any headaches in the future.

  • I found a question in stackoverflow similar, according to the answer accepts if Voce uninstall the smartphone app before having the eclipse run the error does not occur.

  • @seamusd the solution proposed in the global Stack Overflow has worked and you just want to understand why the solution is that or not yet solved the darn error?

  • @Jose the problem still occurs in my application. I wanted to understand why it occurs, if it is a bug from the IDE; if the occurrence is exactly related to the application; or even if it is by the device.

Show 5 more comments

2 answers

1

Guy this error is common compared to Android version (api 10). Error link Google Code

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

Another option is if possible to change the development api.

The fact is that there is nothing in relation to the code/IDE but a possible bug in the version used.

  • I did not understand what is the relation that has the question with the link that you inserted.

  • Link is about a word exchange about the same mistake in question that you’re having in Google Code. In which the plausible solutions are those in question that I quoted above after the readings of the comments. Is there a possibility to switch from Eclipse to Androidstudio to Build Apk? If so, try the test.

0


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

What is the cause of 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 depart specifically from a routine within the app.

What can happen if the error persists?

There will only be some kind of problem if the .apk located in the server versioning is not signed with the same key. This way, the application will not be installed.

How to correct this error?

As I said in the above answer, there will be no error if the application has the same key.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.