apktool No resource identifier found for attribute 'compileSdkVersion' in package 'android'
阿新 • • 發佈:2021-06-21
正在編譯 APK 檔案... (按下 ESC 取消) Executing command: java.exe -jar "D:\Android\APK Easy Tool\Apktool\apktool_2.5.0.jar" b -f -o "D:\Android\APK Easy Tool\2-Recompiled APKs\1.apk" "D:\Android\APK Easy Tool\1-Decompiled APKs\1" I: Using Apktool 2.5.0 I: Smaling smali folder into classes.dex... I: Smaling smali_classes2 folder into classes2.dex... I: Smaling smali_classes3 folder into classes3.dex... I: Smaling smali_classes4 folder into classes4.dex... I: Building resources... W: D:\Android\APK Easy Tool\1-Decompiled APKs\1\AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersion' in package 'android' W: W: D:\Android\APK Easy Tool\1-Decompiled APKs\1\AndroidManifest.xml:1: error: No resource identifier found for attribute 'compileSdkVersionCodename' in package 'android' W: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [D:\Users\ADMINI~1\AppData\Local\Temp\brut_util_Jar_7599633345573570578660851535604158270.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 26, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, D:\Users\ADMINI~1\AppData\Local\Temp\APKTOOL7074245006269868000.tmp, -e, D:\Users\ADMINI~1\AppData\Local\Temp\APKTOOL7491192477025926598.tmp, -0, arsc, -I, D:\Users\Administrator\AppData\Local\apktool\framework\1.apk, -S, D:\Android\APK Easy Tool\1-Decompiled APKs\1\res, -M, D:\Android\APK Easy Tool\1-Decompiled APKs\1\AndroidManifest.xml] 編譯失敗。 請閱讀日誌
重新編譯時,出現這種錯誤.
主要原因是因為apktool編譯的時候,無法識別compileSdkVersion&compileSdkVersionCodename屬性.
手動刪除AndroidManifest.xml中這兩個屬性,然後再執行編譯命令即可.
也可以通過APK Easy Tool 1.5.9.2進行操作,完全替代手動命令.
還有一個小提示:
現在所有GUI型別的APK反編譯工具,基本上都是依賴 JDK 1.8 的.
所以,請確保本機的JDK已經正確安裝或者正確配置.
cmd java -version java version "1.8.0_291" Java(TM) SE Runtime Environment (build 1.8.0_291-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)