Android Studio 3.0和gradle升级 - 创建apk时缺少base.apk代码

时间:2022-12-03 20:50:56

I tried to upgrade my gradle from 2.3.3 to 3.0.0 in Android Studio 3.0 (stable).

我尝试在Android Studio 3.0(稳定版)中将我的gradle从2.3.3升级到3.0.0。

Project builds fine but I get issue while creating/installing APK:

项目构建正常但我在创建/安装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

If I build standalone APK and install it directly on device/emulator I get that it is malformed/incorrect.

如果我构建独立的APK并将其直接安装在设备/模拟器上,我会发现它格式错误/不正确。

Project is with Kotlin, and DexGuard 8.0.12 which should allow for Kotlin and gradle 3.0.

项目是Kotlin和DexGuard 8.0.12,它应该允许Kotlin和gradle 3.0。

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).

更令人讨厌的事实是,在恢复到2.3.3 gradle(Clean&Invalidate,Clean Build,删除/构建路径 - 我尝试了所有这些)后,问题仍然存在。

2 个解决方案

#1


0  

Fix was to update to DexGuard 8.0.17 (not listed yet in release notes).

修复是更新到DexGuard 8.0.17(尚未在发行说明中列出)。

#2


0  

The issue is fixed in DexGuard 8.1.11.

该问题已在DexGuard 8.1.11中修复。

#1


0  

Fix was to update to DexGuard 8.0.17 (not listed yet in release notes).

修复是更新到DexGuard 8.0.17(尚未在发行说明中列出)。

#2


0  

The issue is fixed in DexGuard 8.1.11.

该问题已在DexGuard 8.1.11中修复。