Yarden Cohen
Yarden Cohen

Reputation: 594

Application installation failed

I'm trying to write my first android app, I have alreadu managed to test it and debug on my Tablet which runs Android 4.4 but I couldn't run it on my mobile phone which runs Android 5.1.1 I googled it everywhere but I couldn't find any solution.. I have downloaded A-L-L SDK files (costed me about 60 GB) and still nothing works.. The main error is this:

enter image description here

on the Run console it says this:

    pkg: /data/local/tmp/yarden4.myappsname
Error: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.

here is a logcat cropped to the specific time where I try to run:

12-16 03:19:16.543 16411-16411/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-16 03:19:16.547 16411-16411/? D/AndroidRuntime: CheckJNI is OFF
12-16 03:19:16.653 16411-16411/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
12-16 03:19:16.660 16411-16411/? E/Pm: Error
                                       java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.
                                           at android.os.Parcel.readException(Parcel.java:1553)
                                           at android.os.Parcel.readException(Parcel.java:1505)
                                           at android.content.pm.IPackageManager$Stub$Proxy.installPackageAsUser(IPackageManager.java:3033)
                                           at com.android.commands.pm.Pm.runInstall(Pm.java:958)
                                           at com.android.commands.pm.Pm.run(Pm.java:143)
                                           at com.android.commands.pm.Pm.main(Pm.java:101)
                                           at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
                                           at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
12-16 03:19:16.662 16411-16411/? I/art: System.exit called, status: 1
12-16 03:19:16.662 16411-16411/? I/AndroidRuntime: VM exiting with result code 1.

I also tried: reinstalling android studio / searching for the app installed somehow on my phone (its nor in app list and nor in data/app folders) / messing with google play service app.. / tried different apps.. even a clean neat hello world won't run.. and I'll mention again.. it works fine on my tablet.

P.S my phone and tablet are rooted + xposed + non original ROMs (both)

any idea what to do? I'm stuck for days with this thing.. :(

Thanks ALOT ahead!

Upvotes: 1

Views: 1780

Answers (3)

ytbryan
ytbryan

Reputation: 2694

If you are here because you rename your project directory and gotten the following error:

enter image description here

The solution is to simply go to menu > Build > Clean Project. Then, click run app (the green arrow).

This will force the project to clean up those build at app/build which i think is causing problem.

Upvotes: 0

Yarden Cohen
Yarden Cohen

Reputation: 594

Ok I don't quite sure what was exactly the problem but I have managed to solve it.

The solution was to switch ROM.. :\ I just flashed a different ROM from the same version, pretty much the same.. I didn't even wipe anything so I left with everything I had.. but that fixed it..

I Hope that might help someone else as well.

Upvotes: 1

Virthuss
Virthuss

Reputation: 3213

You can add the following line in your permissions, in your Android manifest file

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

If the problem remains: - Clean and rebuild - Check if your phone didn't have some permissions turned off

You can finally give a look to this link if none of the solutions above are working: Permission is only granted to system app

Upvotes: 0

Related Questions