Search code examples
android-things

Cannot replace app: app is automatically re-installed on boot


I have an app installed on Android Things, in a Raspberry Pi. I want to replace with a newer version, but it's overwritten with previous version after a reboot. That's weird!

This is what I've tried: Let's say the installed app package name is "com.myapp", I've run "adb uninstall com.myapp", and I get "Success". If I run uninstall command again, I get "Failure [DELETE_FAILED_INTERNAL_ERROR]", so the app is completely uninstalled. Then, I've modified package name in build.gradle to "com.mynewapp", and I install and run it using Run button from Android Studio. Now "com.mynewapp" appears when I run "adb shell pm list packages". Now I restart the Pi using "adb shell reboot". And after reboot, the old app is running. Executing "adb shell pm list packages" shows my old package: "com.myapp", and "com.mynewapp" does not appear in the list.

How can I completely remove the old app, and replace with a new one?


Solution

  • I tried deleting all SD contents, and flash latest Android Things image, and I realized SD card is corrupt. I replaced SD card, and it's working fine.