问题描述
我尝试在 Android Studio 3.0(稳定版)中将我的 gradle 从 2.3.3 升级到 3.0.0.
I tried to upgrade my gradle from 2.3.3 to 3.0.0 in Android Studio 3.0 (stable).
项目构建良好,但我在创建/安装 APK 时遇到问题:
Project builds fine but I get issue while creating/installing APK:
Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/xxxx Package /data/app/xxxx/base.apk code is missing]
$ adb shell pm uninstall xxxx
Unknown failure (at android.os.Binder.execTransact(Binder.java:674))
Error while Installing APK
如果我构建独立的 APK 并将其直接安装在设备/模拟器上,我会发现它格式错误/不正确.
If I build standalone APK and install it directly on device/emulator I get that it is malformed/incorrect.
项目使用 Kotlin 和 DexGuard 8.0.12,这应该允许 Kotlin 和 gradle 3.0.
Project is with Kotlin, and DexGuard 8.0.12 which should allow for Kotlin and gradle 3.0.
更烦人的是,在恢复到 2.3.3 gradle 后问题仍然存在(Clean & Invalidate、Clean Build、remove/build 路径 - 我都试过了).
What is more annoying is fact that issue persist event after reverting to 2.3.3 gradle (Clean & Invalidate, Clean Build, remove /build paths - I tried it all).
推荐答案
该问题已在 DexGuard 8.1.11 中修复.
The issue is fixed in DexGuard 8.1.11.
这篇关于Android Studio 3.0 和 gradle 升级 - 创建 apk 时缺少 base.apk 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!