3

I got a problem with Android Studio 3 canary 2, generate APK file always be a TEST version and can't install on any devices unless using command "adb install -t apkname".

The error is Failure [INSTALL_FAILED_TEST_ONLY]

Vinh.TV
  • 299
  • 3
  • 17
  • This is on purpose. Works as designed. – Henry Jun 03 '17 at 11:01
  • @IntelliJAmiya it has not released yet. – Vinh.TV Jun 05 '17 at 02:22
  • I have the same problem with 3.0 beta 7 and I can't publish my APK to the store anymore because of my release APK being a 'test' APK. I don't understand @Henry 's answer. Could you provide more helpful insights? I use Realm which asked me to use some gradle features requiring studio 3.0 apparently. So now when I go back to 2.3 I can't build either... – Gabriel Morin Oct 10 '17 at 07:38
  • Possible duplicate of [ADB Install Fails With INSTALL\_FAILED\_TEST\_ONLY](https://stackoverflow.com/questions/25274296/adb-install-fails-with-install-failed-test-only) – Henry Oct 10 '17 at 08:00
  • @GabrielMorin see here https://stackoverflow.com/a/42969467/1796579 – Henry Oct 10 '17 at 08:04
  • I actually found another solution in my case, I will suggest it as an answer – Gabriel Morin Oct 10 '17 at 08:24

1 Answers1

2

I had the same problem with Android Studio 3.0.0 Beta 7

As stated here: https://developer.android.com/studio/run/index.html

Note: The Run button builds an APK with testOnly="true", which means the APK can only be installed via adb (which Android Studio uses). If you want a debuggable APK that people can install without adb, select your debug variant and click Build > Build APK(s).

Same goes for release build, with Android Studio 3 you need to go to Build > Build APK(s) to have a non testable release apk that you can submit to the store.

Gabriel Morin
  • 2,100
  • 1
  • 14
  • 26