【发布时间】:2016-04-20 17:38:06
【问题描述】:
Android Studio 没有将我的 APK 推送到带有 Marshmallow (6.0.1) 的物理 Nexus 5X。
这是输出和错误:
01/15 01:51:48: Launching mobile
$ adb install-multiple -r /Users/MyUser/AndroidStudioProjects/MyApp/mobile/build/outputs/apk/mobile-development-debug-unaligned.apk /Users/MyUser/AndroidStudioProjects/MyApp/mobile/build/intermediates/split-apk/development/debug/main.apk /Users/MyUser/AndroidStudioProjects/MyApp/mobile/build/intermediates/split-apk/development/debug/main.apk
Error installing split apks: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_INVALID_APK: Split lib_main was defined multiple times
Error during launch
详情:
默认配置: minSdkVersion 9 targetSdkVersion 23 multiDexEnabled 是的
2 buildTypes:调试和发布
2 productFlavors:开发和生产
dex 选项: 增量错误 preDexLibraries = 假 巨型模式 = 真 javaMaxHeapSize "4096M"
我正在使用最新的 Android Studio 2.0 Preview 5 (http://tools.android.com/recent/androidstudio20preview5available)。
Gradle:distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip
构建工具是:'com.android.tools.build:gradle:2.0.0-alpha5'。
有没有办法告诉 Android Studio 不使用 install-multiple 来安装 apk?
更新(美国东部标准时间 2016 年 1 月 15 日凌晨 2:26):
在带有 Jelly Bean (4.3.1) 的 Galaxy Nexus 模拟器或带有 Gingerbread (2.3.6) 的实体三星 Galaxy S 上运行应用程序时不会出现此问题。
更新(美国东部标准时间 2016 年 1 月 15 日上午 11:30):
在装有 KitKat (4.4.4) 的 Nexus 5 上运行该应用,它运行良好。
【问题讨论】:
-
你在使用 NDK 吗?
-
否 @andresperezl,不使用 NDK。奇怪的是,带有 Jelly Bean 的 Galaxy Nexus 模拟器和带有 Gingerbread 的实体三星 Galaxy S 都不会出现此问题。
-
您在哪个设备和 Android 版本上运行此应用?
-
@RacZo 禁用即时运行。
标签: java android android-studio android-gradle-plugin