I am having issues installing an apk to my device.
adb install <.apk>
Using the above command returns the following:
5413 KB/s (99747 bytes in 0.017s)
pkg: /data/local/tmp/AppClient.TestOnly.App3.apk
Failure [INSTALL_FAILED_TEST_ONLY]
Any idea on what might cause this issue?
It definitely recognizes the device. Could it be an issue with the apk?
I had a similar problem with
Android Studio 3.0.0 Beta 7
and could not publish anymore to the play store.As stated here: https://developer.android.com/studio/run/index.html
Same goes for release build, with
Android Studio 3
you need to go toBuild > Build APK(s)
to have a non testable release apk that you can submit to the store.In my case was by uploading an APK, that although it was signed with production certificate and was a release variant, was generated by the run play button from Android studio. Problem solved after generating APK from Gradle or from Build APK menu option.
add this line to your ‘gradle.properties’
I don't know if it's gonna be useful for anyone or not, but I got this error message, when I accidentally tried to build and install my project with test gradle plugin (
'gradle:2.4.0-alpha5'
) version in stable Android Studio version (2.3
, not in2.4 preview 5
version I'd downloaded and installed before).When I realized my mistake, I launched preview Android Studio version and it built and installed my project without any problem.
Looks like you need to modify your
AndroidManifest.xml
Change
android:testOnly="true"
toandroid:testOnly="false"
or remove this attribute.If you want to keep the attribute
android:testOnly
astrue
you can usepm install
command with-t
option, but you may need topush
the apk to device first.I was able to reproduce the same issue and the above solved it.
If your APK is outside the device (on your desktop), then below command would do it:
I agree with Elisey. I got this same error after opening my project in the 2.4 preview and then opening the same project in android studio 2.3
Fixed the issue by changing this line in build.gradle from
to