Failure [INSTALL_FAILED_INVALID_APK]

后端 未结 30 1511
庸人自扰
庸人自扰 2020-11-27 04:12

When I click to run a project I just created in Android Studio 0.2.10 and select my Android (connected by USB with debug by USB on) I get this error:

Waiting         


        
相关标签:
30条回答
  • 2020-11-27 04:27

    I had this issue and none of the above solutions worked for me.

    The reason is probably root version phone that has available quota or apk install permissions only at the sdcard.

    I fixed the issue using ADB (you'll need a rooted device):

    1. Connect your phone via USB
    2. Launch ADB using adb shell
    3. Switch to root mode using su
    4. create tmp folder in the sdcard: mkdir /sdcard/tmp
    5. cd /data/local
    6. create link the the folder in the sdcard: ln -s /sdcard/tmp tmp
    0 讨论(0)
  • 2020-11-27 04:28

    I got this issue on a project with Dagger and multiple modules. What worked for me (none of the above worked) was to 1) empty the .gradle folder 2) empty the .idea folder 3) In project gradle.properties, mark org.gradle.caching=false 4) Possibly invalidate caches in AS, clean, rebuild

    You may be able to get away with just #3, clean then build.

    EDIT: Lately I've been able to get around this by restarting AS, then doing a clean, then install again.

    0 讨论(0)
  • 2020-11-27 04:30

    I ran into this issue by having mismatched build variants. A Dynamic Delivery module was on the debug variant while the remaining modules were on release. Simply changing the Dynamic Delivery module to release, rebuilding, and installing, fixed the issue.

    0 讨论(0)
  • 2020-11-27 04:31

    I had this issue and none of the above solutions worked for me.

    For some reason, the permissions weren't set correctly on my /data/local/tmp directory (only root had rwx). I fixed the issue using ADB (you'll need a rooted device):

    1. Connect your phone via USB
    2. Launch ADB using adb shell
    3. Move to /data/local using cd /data/local
    4. Switch to root mode using su
    5. Allow read/write/execute on tmp directory using chmod 777 tmp
    6. Disconnect, restart Android Studio and plug in device again
    0 讨论(0)
  • 2020-11-27 04:32

    I was getting this in Android Studio and all I did to fix it was go to "Build" > "Clean Project" and it just worked.

    0 讨论(0)
  • 2020-11-27 04:33

    I have used the androidquickstart maven archetype and faced the same problem:

    My package name was an only androidquickstart. According to advices before

    1. I have changed the package to androidquickstart.test
    2. then in AndroidManifest.xml I have changed package="androidquickstart" to package="androidquickstart.test" and correspondingly removed test from other parts of xml <activity android:name=".test.HelloAndroidActivity" > to <activity android:name=".HelloAndroidActivity" >
    3. and also fixed package issues in java files (highlighted by the IDE)
    0 讨论(0)
提交回复
热议问题