[android]*_intermediates 生成异常

文章讲述了在将MTK应用源码移植到RK平台时遇到的*_intermediates编译问题,涉及framework模块名称调整和配置修改,以及classes.dex生成异常的解决方法。

记录一次从MTK移植应用源码到RK平台后,编译是出现 *_intermediates 生成异常的问题

1、*_intermediates 依赖找不到

FAILED: ninja: 'out/target/common/obj/JAVA_LIBRARIES/mediatek-framework_intermediates/exported-sdk-libs', needed by 'out/target/common/obj/APPS/FactoryMode_intermediates/exported-sdk-libs', missing and no known rule to make it

上面是由于MTK与RK的framework模块名称定义不同修改下配置即可,如下:

MTK:
LOCAL_JAVA_LIBRARIES :=mediatek-framework \
			telephony-common 

RK:
LOCAL_JAVA_LIBRARIES :=framework \
			telephony-common 
2、应用对应的*_intermediates 生成异常

FAILED: out/target/common/obj/APPS/FactoryMode_intermediates/classes.dex
/bin/bash -c "(rm -f out/target/common/obj/APPS/FactoryMode_intermediates//classes*.dex ) && (cp -fp out/target/common/obj/APPS/FactoryMode_intermediates/dex//classes*.dex out/target/common/obj/APPS/FactoryMode_intermediates/ )"
cp: bad 'out/target/common/obj/APPS/FactoryMode_intermediates/dex//classes*.dex': No such file or directory

*_intermediates生成异常的话,那极大可能是源码文件配置存在问题

像是这里的配置:

左边的为mtk,右边的rk

在rk平台编译时,修改下追加方式即可修复上述的intermediates生成异常问题

[ 3% 989/30520] Building with Jack: out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/with-local/classes.dex FAILED: /bin/bash -c "(rm -f out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/with-local/classes.dex ) && (rm -f out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jack ) && (rm -rf out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/jack-rsc ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/with-local/ ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/ ) && (mkdir -p out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/jack-rsc ) && (rm -f out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/jack-rsc/java-source-list ) && (touch out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/jack-rsc/java-source-list ) && (echo -n 'libcore/dex/src/main/java/com/android/dex/Annotation.java libcore/dex/src/main/java/com/android/dex/ClassData.java libcore/dex/src/main/java/com/android/dex/ClassDef.java libcore/dex/src/main/java/com/android/dex/Code.java libcore/dex/src/main/java/com/android/dex/Dex.java libcore/dex/src/main/java/com/android/dex/DexException.java libcore/dex/src/main/java/com/android/dex/DexFormat.java libcore/dex/src/main/java/com/android/dex/DexIndexOverflowException.java libcore/dex/src/main/java/com/android/dex/EncodedValue.java libcore/dex/src/main/java/com/android/dex/EncodedValueCodec.java libcore/dex/src/main/java/com/android/dex/EncodedValueReader.java libcore/dex/src/main/java/com/android/dex/FieldId.java libcore/dex/src/main/java/com/android/dex/Leb128.java libcore/dex/src/main/java/com/android/dex/MethodId.java libcore/dex/src/main/java/com/android/dex/Mutf8.java libcore/dex/src/main/java/com/android/dex/ProtoId.java libcore/dex/src/main/java/com/android/dex/SizeOf.java libcore/dex/src/main/java/com/android/dex/TableOfConten
07-26
FAILED: out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm/boot.art /bin/bash -c "(mkdir -p out/target/product/p12_k37mv1_bsp/symbols/system/framework/arm/ ) && (rm -f out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm//*.art out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm//*.oat out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm//*.art.rel ) && (rm -f out/target/product/p12_k37mv1_bsp/symbols/system/framework/arm//*.art ) && (rm -f out/target/product/p12_k37mv1_bsp/symbols/system/framework/arm//*.oat ) && (rm -f out/target/product/p12_k37mv1_bsp/symbols/system/framework/arm//*.art.rel ) && (ANDROID_LOG_TAGS=\"*:e\" out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx64m --compiler-filter=speed-profile --profile-file=out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/boot.prof --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-framework_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-telephony-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-telephony-base_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/okhttp_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/apache-xml_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/voip-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/ims-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.hidl.base-V1.0-java_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.hidl.manager-V1.0-java_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/framework-oahl-backward-compatibility_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/android.test.base_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-ims-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-telecom-common_intermediates/javalib.jar --dex-file=out/target/common/obj/JAVA_LIBRARIES/mediatek-cta_intermediates/javalib.jar --dex-location=/system/framework/mediatek-common.jar --dex-location=/system/framework/mediatek-framework.jar --dex-location=/system/framework/mediatek-telephony-common.jar --dex-location=/system/framework/mediatek-telephony-base.jar --dex-location=/system/framework/core-oj.jar --dex-location=/system/framework/core-libart.jar --dex-location=/system/framework/conscrypt.jar --dex-location=/system/framework/okhttp.jar --dex-location=/system/framework/bouncycastle.jar --dex-location=/system/framework/apache-xml.jar --dex-location=/system/framework/ext.jar --dex-location=/system/framework/framework.jar --dex-location=/system/framework/telephony-common.jar --dex-location=/system/framework/voip-common.jar --dex-location=/system/framework/ims-common.jar --dex-location=/system/framework/android.hidl.base-V1.0-java.jar --dex-location=/system/framework/android.hidl.manager-V1.0-java.jar --dex-location=/system/framework/framework-oahl-backward-compatibility.jar --dex-location=/system/framework/android.test.base.jar --dex-location=/system/framework/mediatek-ims-common.jar --dex-location=/system/framework/mediatek-telecom-common.jar --dex-location=/system/framework/mediatek-cta.jar --oat-symbols=out/target/product/p12_k37mv1_bsp/symbols/system/framework/arm/boot.oat --oat-file=out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm/boot.oat --oat-location=/system/framework/arm/boot.oat --image=out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm/boot.art --base=0x70000000 --instruction-set=arm --instruction-set-variant=cortex-a53 --instruction-set-features=default --android-root=out/target/product/p12_k37mv1_bsp/system --runtime-arg -Xnorelocate --compile-pic --no-generate-debug-info --generate-build-id --multi-image --no-inline-from=core-oj.jar --abort-on-hard-verifier-error --abort-on-soft-verifier-error --no-abort-on-soft-verifier-error --generate-mini-debug-info || ( echo \"ERROR: Dex2oat failed to compile a boot image. It is likely that the boot classpath is inconsistent. Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS=\"--runtime-arg -verbose:verifier\" to see verification errors.\" ; false ) && ANDROID_LOG_TAGS=\"*:e\" ANDROID_ROOT=out/target/product/p12_k37mv1_bsp/system ANDROID_DATA=out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm/ out/host/linux-x86/bin/patchoatd --input-image-location=out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/boot.art --output-image-relocation-directory=out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/arm/ --instruction-set=arm --base-offset-delta=0x10000000 )" patchoatd E 08-01 17:32:01 1225778 1225778 image_space.cc:1761] Could not create image space with image file 'out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/boot.art'. Attempting to fall back to imageless running. Error was: Failed to mmap at expected address, mapped at 0x7ead86400000 instead of 0x7057a000 patchoatd E 08-01 17:32:01 1225778 1225778 image_space.cc:1761] Attempted image: out/target/product/p12_k37mv1_bsp/dex_bootjars/system/framework/boot-framework.art patchoatd E 08-01 17:32:01 1225778 1225778 runtime.cc:1290] Dex file fallback disabled, cannot continue without image. patchoatd E 08-01 17:32:01 1225778 1225778 patchoat.cc:485] Unable to initialize runtime ninja: build stopped: subcommand failed. 17:32:01 ninja failed with: exit status 1 怎么关闭掉
08-02
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值