我想在Google Tango平板電腦上安裝應用程序,而我的根目錄就是這樣。 我也試過用make -j
和ant debug install
進行編譯,即使它以BUILD SUCCESSFUL
結尾,我仍然有錯誤[exec] Failure [INSTALL_FAILED_DEXOPT]
。該應用程序不安裝在平板電腦上。Android:[exec] Failure [INSTALL_FAILED_DEXOPT]
我跑了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/[email protected]@[email protected]
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/[email protected]@[email protected]' 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,但我無法找到它們是否相互兼容。 但它應該工作,因爲它以前在同一臺平板電腦上,但不同的計算機上。相同的代碼。