Android Studio: Failure INSTALL_FAILED_TEST_ONLY

Starting application from Android Studio may fail with the mysterious message: Installation failed with message INSTALL_FAILED_TEST_ONLY.

The IDE will prompt you whether you want to uninstall the existing application.

Even this uninstallation may fail. When you open Run console, you can see something like this:

$ adb shell pm uninstall rocks.georgik.sdlapp
$ adb shell pm install -r "/data/local/tmp/rocks.georgik.sdlapp"
	pkg: /data/local/tmp/rocks.georgik.sdlapp

$ adb shell pm uninstall rocks.georgik.sdlapp
Error while Installing APK

Potential Fix #1

There is a relatively simple fix to this issue. Click drop-down menu with your configuration and choose Edit Configurations…

Select tab General and add -t to Install Flags field. Click Ok.

Now start the application again and it should work.

Potential fix #2

This error migh occur if you moved the project from other computer where it was stored in different directory. To resolve the problem: Clean the project and build it again.

If this article didn’t help you to resolve your issue with Android Studio please let me know in comments below. There might be also other reasons for the error and we can discuss them.

Rating: 2.8/5. From 8 votes.
Please wait...

16. July 2017 at 22:07 - Development (Tags: , , , , ). Both comments and pings are currently closed.

0 0 votes
Article Rating
1 Comment
Inline Feedbacks
View all comments
Зуев Роман
4 years ago

“-t” doesn’t work for me, though I have same error

Go to “Settings” -> “Build, execution, deployment” and disable “instant run to hot swap code…”

This solved my problem, but, unfortunately, hot swapping isn’t working anymore

No votes yet.
Please wait...