Android:[exec]失败[INSTALL_FAILED_DEXOPT]

时间:2017-06-14 08:51:56

标签: android ant google-project-tango android-install-apk

我想在谷歌Tango平板电脑上安装一个应用程序,我是root用户。 我也尝试使用make -jant debug install进行编译,即使以[exec] Failure [INSTALL_FAILED_DEXOPT]结尾,我也会遇到错误BUILD SUCCESSFUL。该应用无法在平板电脑上安装。

我运行了一个logcat,这是(对我而言)相关的捕获:

I/PackageManager(  929): onServiceConnected
D/DefContainer( 3008): internal storage: block size=4096, # of available blocks=28501958
D/DefContainer( 3008): internal storage: availInternalSize=116744019968, apk size=4629092
W/ActivityManager(  929): No content provider found for permission revoke: file:///data/local/tmp/superstuff-debug.apk
W/ActivityManager(  929): No content provider found for permission revoke: file:///data/local/tmp/superstuff-debug.apk
I/PackageManager(  929): Copying native libraries to /data/app-lib/vmdl-1009153656
I/PackageManager(  929): Checking for more work or unbind...
I/PackageManager(  929): Posting delayed MCS_UNBIND
I/PackageManager(  929): Running dexopt on: fr.my.superstuff
I/dex2oat ( 3216): dex2oat: /data/dalvik-cache/data@app@fr.my.superstuff-1.apk@classes.dex
E/dex2oat ( 3216): Unrecognized version number in /data/app/fr.my.superstuff-1.apk: 0 3 8 
E/dex2oat ( 3216): Failed to open dex file '/data/app/fr.my.superstuff-1.apk' from memory
E/dex2oat ( 3216): Failed to open dex from file descriptor for zip file: /data/app/fr.my.superstuff-1.apk
W/installd(  168): DexInv: --- END '/data/app/fr.my.superstuff-1.apk' --- status=0x0100, process failed
E/installd(  168): dexopt in='/data/app/fr.my.superstuff-1.apk' out='/data/dalvik-cache/data@app@fr.my.superstuff-1.apk@classes.dex' res=256
W/PackageManager(  929): Package couldn't be installed in /data/app/fr.my.superstuff-1.apk
D/AndroidRuntime( 3204): Shutting down VM
E/WifiController(  929): Not handled here 155652

我尝试用adb shell su通过目录导航,但我想在logcat中写的所有文件都是临时的,因为我无法找到它们。 这是我的Makefile:

MAIN_ACTIVITY=fr.my.superstuff/.$(shell grep "<activity android:name" AndroidManifest.xml | cut -d\" -f2)
SDK_PATH=/people/me/Documents/Android/sdk
NDK_PATH=/people/me/Documents/Android/android-ndk-r10e

APP_TAG=ARViewer
LOG_FILTER=$(APP_TAG):V NativeApp:V VES:V AndroidRuntime:E libEGL:W StrictMode:V libc:F DEBUG:I

all: compile-debug

compile-debug:
    +$(NDK_PATH)/ndk-build -j NDK_DEBUG=1
    cp thirdparty/TangoSDK_Gemma_Java.jar libs/ 
    cp thirdparty/QCAR/libs/armeabi-v7a/libQCAR.so libs/armeabi-v7a/
    cp thirdparty/QCAR/libs/QCAR-hacked.jar libs/
    ant -Djava.compilerargs=-Xlint debug installd

# compile-release:
#   LC_ALL= $(NDK_PATH)/ndk-build -j NDK_DEBUG=0
#   ant release installr

# fast-compile-debug:
#   @/bin/zsh -c 'echo > /tmp/.ant-input && echo > /tmp/.ant-output && \
#       echo fast-compile-debug >> /tmp/.ant-input && \
#       ( while IFS='' read -r line; do echo "$$line"; \
#       [[ "$$line" =~ "^ant>" ]] && exit; done \
#       < <(tailf /tmp/.ant-output)) | strings'

clean:
    ant clean
    rm -rf obj libs

test:
    @urxvt -e sh -c "adb logcat -c; adb shell am start -n $(MAIN_ACTIVITY); adb logcat -s $(LOG_FILTER)"

debug-java:
    adb shell am start -e debug true -n $(MAIN_ACTIVITY)
    adb forward tcp:7777 jdwp:$$(adb jdwp | tail -1)
    jdb -sourcepath src -attach localhost:7777

debug-native:
    adb shell am start -e debug true -n $(MAIN_ACTIVITY)
    $(NDK_PATH)/ndk-gdb

log:
    adb logcat -s $(LOG_FILTER)

我不知道如何解决这个错误。我看到了其他堆栈线程,但它并没有帮助我。我没有使用Android工作室,也没有使用任何编辑器,我只是为了安装它而获得此代码,然后再进行解决。

编辑:经过一些搜索后,我发现它可能与dex文件有关,如logcat所述。平板电脑使用的是Android 4.4.2,而dex是038,但我无法找到彼此之间的兼容性。 但它应该工作,因为它在同一台平板电脑上工作但不同的计算机。相同的代码。

1 个答案:

答案 0 :(得分:1)

解决! 这是一个版本问题:平板电脑在我安装SDK 26的计算机上运行Android 4.4 KitKat,但KitKat运行的是SDK 19,可以使用sdkmanager下载。然而,我错过了ant文件夹,所以我下载了它,但它没有附带ant build.xml文件。所以我从SDK 25(这里链接The ant/ folder is suddenly missing from Android SDK. Did Google remove it?)野蛮地把它拿走了。 现在安装!