简体   繁体   English

安卓工作室2.4预览7中的INSTALL_FAILED_TEST_ONLY

[英]INSTALL_FAILED_TEST_ONLY in Android studio 2.4 preview 7

I'm using Android Studio 2.4 preview 7 version. 我正在使用Android Studio 2.4预览版7。 But, when I build debug apk and install via adb command or put apk file in sdcard of device it always gives me same error "App not installed" in any of android phone. 但是,当我构建调试apk并通过adb命令安装或将apk文件放入设备的SD卡时,它总是在任何Android手机中给我同样的错误“App not installed”。 I have got INSTALL_FAILED_TEST_ONLY error in Android Logcat every time at the time of installation in any android device. 每次在任何Android设备上安装时,我都会在Android Logcat中出现INSTALL_FAILED_TEST_ONLY错误。

If you analyze your apk file you'll see the problem easily - namely that when building the project with the mentioned Android Studio version, the Gradle plugin is automatically injecting an android:testOnly=true to the final AndroidManifest.xml file of the output apk. 如果您分析您的apk文件,您将很容易看到问题 - 即在使用上述Android Studio版本构建项目时,Gradle插件会自动将android:testOnly=true注入到输出apk的最终AndroidManifest.xml文件中。

You can read more about this property and what it's used for HERE . 您可以阅读有关此属性的更多信息以及它在此处使用的内容。

To workaround this problem - you can still install the app using this command: 要解决此问题 - 您仍然可以使用以下命令安装应用程序:

adb install -t debug.apk

If you want to build a signed release version of your app (eg for publishing the Play Store), you can always do so via Build -> Generate Signed APK . 如果您想构建应用程序的签名release版本(例如,用于发布Play商店),您可以通过Build -> Generate Signed APK The result is an apk without the mentioned property and can be installed on any device. 结果是没有提到属性的apk,可以安装在任何设备上。

If you want a bit of context why this property is injected, perhaps check THIS and THIS issues on the AOSP bug tracker. 如果你想要一些上下文为什么注入这个属性,也许在AOSP bug跟踪器上检查这个这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Android Studio 3.0 中获取失败 [INSTALL_FAILED_TEST_ONLY: installPackageLI] - getting Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] in Android studio 3.0 运行失败并出现 INSTALL_FAILED_TEST_ONLY - run fails with INSTALL_FAILED_TEST_ONLY 无法通过INSTALL_FAILED_TEST_ONLY安装APK - Failed to install APK with INSTALL_FAILED_TEST_ONLY Android运行失败,并显示消息无法完成会话:INSTALL_FAILED_TEST_ONLY - Android run fails with message Failed to finalize session: INSTALL_FAILED_TEST_ONLY ADB 安装失败并显示 INSTALL_FAILED_TEST_ONLY - ADB Install Fails With INSTALL_FAILED_TEST_ONLY 如何解决 AWS Device Farm 测试运行中的错误 [INSTALL_FAILED_TEST_ONLY: installPackageLI] - How do I work around the error [INSTALL_FAILED_TEST_ONLY: installPackageLI] in AWS Device Farm test run 在Android Studio 2.4 Preview 5中导入圆形启动器图标的方法 - A way to import rounded launcher icon in Android Studio 2.4 Preview 5 Andrios Studio中的Android Test提供了INSTALL_FAILED_VERSION_DOWNGRADE - Android Test in Andrios Studio gives INSTALL_FAILED_VERSION_DOWNGRADE 在Android Studio中渲染布局预览失败 - Render layout preview failed in android studio Android Studio 2.0 Preview:':app:transformClassesWithInstantRunForDebug'FAILED - Android Studio 2.0 Preview: ':app:transformClassesWithInstantRunForDebug' FAILED
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM