Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio does not install latest application on device

I'm following some tutorials about building apps in Android Studio, but for some reason it's not launching/installing the latest version of my app when I click 'run'. I have to manually uninstall the app on the phone and then click run after making changes in Android Studio for the app to get updated. Any ideas?

Here is the console output:

Waiting for device.
Target device: htc-htc_one_m8
Uploading file
    local path: /home/brandon/AndroidStudioProjects/JustJava/app/build/outputs/apk/app-debug.apk
    remote path: /data/local/tmp/com.example.android.justjava
No apk changes detected. Skipping file upload, force stopping package instead.
DEVICE SHELL COMMAND: am force-stop com.example.android.justjava
Launching application: com.example.android.justjava/com.example.android.justjava.MainActivity.
DEVICE SHELL COMMAND: am start -D -n "com.example.android.justjava/com.example.android.justjava.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.android.justjava/.MainActivity }

Waiting for process: com.example.android.justjava
Connected to the target VM, address: 'localhost:8638', transport: 'socket'
Disconnected from the target VM, address: 'localhost:8638', transport: 'socket'
like image 746
brandon Avatar asked Sep 20 '15 21:09

brandon


Video Answer


4 Answers

No apk changes detected. Skipping file upload, force stopping package instead.

Android Studio thinks that there are no changes and doesn't install the new APK. A workaround is to disable the "Skip installation if APK has not changed" option in Run > Edit Configurations.

Screenshot on Android Studio 1.4


I'm using Android Studio 1.4
Source: https://code.google.com/p/android/issues/detail?id=160901

like image 50
galdin Avatar answered Oct 14 '22 05:10

galdin


Android Studio thinks that there are no changes and doesn't install the new APK. A workaround is to disable the "Skip installation if APK has not changed" option in Run > Edit Configurations >Android Application > app >Miscellaneous . Then uncheck "Skip installation if APK has not changed".

Another problem like this is instant Run you can manage it by :- Just go to "File -> Settings -> Build, Execution, Deployement -> Instant Run" and just disable it. With this Android Studio builds from scratch each time but it's better than not building it right.

like image 36
Akanksha Rathore Avatar answered Oct 14 '22 03:10

Akanksha Rathore


This is actually a bug you can find more info Android Open Source Project - Issue Tracker

Disabling instant run option in edit configuration and adding -r flag to the install flags is best work around for now.!

like image 4
Rahul Avatar answered Oct 14 '22 04:10

Rahul


option in Run > Edit Configurations >Android Application > app >Miscellaneous . Then uncheck "Skip installation if APK has not changed". THEN --> option in Build > clean project and rebuild project and reinstall APK in your device.

THIS WORKS FINE FOR ME, HOPE THIS HELP OTHER ALSO

like image 4
Aashna Choudhary Avatar answered Oct 14 '22 05:10

Aashna Choudhary