Android MTK 預製應用遇到的問題

一.預置uc瀏覽器報錯

FAILED: out/target/product/apower_xj/obj/APPS/UcApp_intermediates/oat/arm64/package.odex 
/bin/bash -c "(rm -f out/target/product/apower_xj/obj/APPS/UcApp_intermediates/oat/arm64/package.odex ) && (mkdir -p out/target/product/apower_xj/obj/APPS/UcApp_intermediates/oat/arm64/ ) && (ANDROID_LOG_TAGS=\"*:e\" out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx512m --class-loader-context=\"&\" --boot-image=out/target/product/apower_xj/dex_bootjars/system/framework/boot.art --dex-file=vendor/mediatek/proprietary/packages/3rd-party/UcApp/UcApp.apk --dex-location=/system/app/UcApp/UcApp.apk --oat-file=out/target/product/apower_xj/obj/APPS/UcApp_intermediates/oat/arm64/package.odex --android-root=out/target/product/apower_xj/system --instruction-set=arm64 --instruction-set-variant=cortex-a53 --instruction-set-features=default --runtime-arg -Xnorelocate --compile-pic --no-generate-debug-info --generate-build-id --abort-on-hard-verifier-error --force-determinism --no-inline-from=core-oj.jar  --compiler-filter=quicken )"
dex2oatd ] Verification error in android.view.View com.ali.user.open.core.webview.WVUcWebViewProxy.getWebView()
dex2oatd ] android.view.View com.ali.user.open.core.webview.WVUcWebViewProxy.getWebView() failed to verify: android.view.View com.ali.user.open.core.webview.WVUcWebViewProxy.getWebView(): [0x2] returning 'Reference: com.ali.user.open.core.webview.MemberUCWebView', but expected from declaration 'Reference: android.view.View'
dex2oatd ] 
dex2oatd ] Had a hard failure verifying all classes, and was asked to abort in such situations. Please check the log.

//編譯出來的APP在源碼中編譯odex失敗問題

 參考:https://blog.csdn.net/kris_fei/article/details/88660382

//解決應用開機加速,生成odex文件報錯問題

 在該應用的mk文件中添加 LOCAL_DEX_PREOPT := false

二.預製某應用時,“libce2and.so” not found

//解決 Error preloading public library libce2and.so: dlopen failed: library “libce2and.so” not found
編譯apk後so文件在dlopen時出現linker權限問題

參考:https://blog.csdn.net/yang542397/article/details/88103951

解決辦法:將apk中的.so文件拷貝到於mk同級目錄下新建lib/arm,在mk中將.so文件拷貝到out/system/app/應用名/lib下
例:


LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

# Module name should match apk name to be installed
LOCAL_MODULE := XXXX
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
#LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/operator/app
LOCAL_MULTILIB :=32
include $(BUILD_PREBUILT)

LOCAL_MODULE_PATH := $(TARGET_OUT)/app
$(warning "start copy lib form $(LOCAL_PATH)/lib to $(LOCAL_MODULE_PATH)/$(LOCAL_MODULE)/")
$(shell mkdir -p $(LOCAL_MODULE_PATH)/$(LOCAL_MODULE)/lib/) 
$(shell cp -f -r $(LOCAL_PATH)/lib  $(LOCAL_MODULE_PATH)/$(LOCAL_MODULE)/)
$(warning "end copy")




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章