apktool No resource identifier found for attribute 'compileSdkVersion' in package 'android'


正在编译 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)
posted @ 2021-06-21 16:40  devs  阅读(1088)  评论(0编辑  收藏  举报