azost
azost

Reputation: 591

Android Studio "install_failed_invalid_apk" error

Im trying to debug a app in Android Studio, but every time i run the app to the phone it says:

Installing com.myapplication2.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.myapplication2.app"
pkg: /data/local/tmp/com.myapplication2.app
Failure [INSTALL_FAILED_INVALID_APK]

Looking to log

06-21 14:31:36.304    5407-5419/com.android.defcontainer W/zipro﹕ Unable to open zip    '/data/local/tmp/com.myapplication2.app': Permission denied
06-21 14:31:36.304    5407-5419/com.android.defcontainer D/asset﹕ failed to open Zip     archive '/data/local/tmp/com.myapplication2.app'
06-21 14:31:36.305    5407-5419/com.android.defcontainer W/PackageParser﹕ Unable to      read AndroidManifest.xml of /data/local/tmp/com.myapplication2.app
java.io.FileNotFoundException: AndroidManifest.xml
        at android.content.res.AssetManager.openXmlAssetNative(Native Method)
        at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:487)
        at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:455)
        at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:729)
        at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:173)
        at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:110)
        at android.os.Binder.execTransact(Binder.java:367)
        at dalvik.system.NativeStart.run(Native Method)
06-21 14:31:36.305    5407-5419/com.android.defcontainer W/DefContainer﹕ Failed to parse package
06-21 14:31:36.306      429-451/system_process W/ActivityManager﹕ No content provider found for permission revoke: file:///data/local/tmp/com.myapplication2.app
06-21 14:31:36.469      429-446/system_process V/Provider/Setting﹕ from settings cache , name = sys_free_storage_log_interval value = null
 06-21 14:31:36.469      429-446/system_process V/Provider/Setting﹕ from settings cache , name = disk_free_change_reporting_threshold value = null    

Maybe the problem is related with "permission denied"? Tried to run Android Studio as Administrator, same issue. Using Windows 8.

I´m able to install the apk by copying to sdcard and installing directly from Android.

This started to happen after:
a) Updated my Android to a custom rom
b) Updated Android Studio from 0.4.6 to 0.5.2

But since both updates were simultaneously, cant say which one is responsible for this error.

Any help is appreciated.

Upvotes: 0

Views: 4299

Answers (1)

liuct
liuct

Reputation: 11

It seems it occurred after you flashed new ROM.

The system memory map altered which lead to permission issue of /data/local/tmp/.

The folder should be executable and readable with shell user.

Upvotes: 1

Related Questions