I tried to upgrade my gradle from 2.3.3 to 3.0.0 in Android Studio 3.0 (stable).
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
If I build standalone APK and install it directly on device/emulator I get that it is malformed/incorrect.
Project is with Kotlin, and DexGuard 8.0.12 which should allow for Kotlin and 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).
Fix was to update to DexGuard 8.0.17 (not listed yet in release notes).
The issue is fixed in DexGuard 8.1.11.
来源:https://stackoverflow.com/questions/47032757/android-studio-3-0-and-gradle-upgrade-base-apk-code-is-missing-while-creating