Anuj Tenani
Anuj Tenani

Reputation: 2094

Compiling android system apps with make

I am trying to compile android system package apps using

make

but the compiled APK is missing classes.dex file.

I have setup initialized and downloaded the android build environment properly. I am using aosp_arm-user as lunch build target.

I am compiling the system apps using command

make -j16 Mms

The apk gets generated in

/out/target/product/generic/system/priv-app/Mms.apk

on installing the generated apk using

adb install Mms.apk

the install fails with the following error

Failure [INSTALL FAILED DEXPOT]

Logcat shows the following error

DexOptZ: zip archive '/data/app/com.android.mms-1.apk' does not include classes.dex

Any hints to solve the issue would be greatly appreciated.

Upvotes: 1

Views: 734

Answers (1)

JesusFreke
JesusFreke

Reputation: 20282

User builds are pre-dexopt'd, meaning that dexopt runs on the apk as part of the build process, and produces a .odex file beside the .apk, rather than a classes.dex inside the apk.

Use an eng or userdebug build to prevent that from happening automatically. e.g.

lunch aosp_arm-userdebug

There may be an environment variable you could use to control the behavior as well.

Upvotes: 2

Related Questions