kefir500/apk-icon-editor

Problems with target SDK or something...

vermelhao opened this issue · 5 comments

Here is the thing, I'm no java expert or anything, and I apologize if it's a dumb mistake on my part, but when I finish editing the apk file and go to Pack APK, I get the following error:

Exception in thread "main" java.lang.NumberFormatException: For input string: "@integer/targe_sdk_version"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at brut.androlib.res.AndrolibResources.mapSdkShorthandToVersion(AndrolibResources.java:630)
at brut.androlib.res.AndrolibResources.checkTargetSdkVersionBounds(AndrolibResources.java:310)
at brut.androlib.res.AndrolibResources.aapt1Package(AndrolibResources.java:506)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:597)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:479)
at brut.androlib.Androlib.buildResources(Androlib.java:424)
at brut.androlib.Androlib.build(Androlib.java:303)
at brut.androlib.Androlib.build(Androlib.java:267)
at brut.apktool.Main.cmdBuild(Main.java:238)
at brut.apktool.Main.main(Main.java:76)

I have both JDK and JRE, and if I'm not mistaken they're both version 8.
Thanks in advance for the help.

Here in the log says that I don't have JDK installed, but I installed it earlier this week!
[11:23:56.993] APK Icon Editor v2.1.0
[11:23:56.993] Initializing...
[11:23:56.994] Starting...

[11:23:56.997] Screen DPI: 96
[11:23:57.050] Language set to "en"

[11:23:57.090] Warning: Problem creating accessible interface for: MainWindow(0xdc79b8)
Make sure to deploy Qt with accessibility plugins.
[11:23:57.540] JRE version: 1.8.0_181
[11:23:57.540] JDK version: ---
[11:23:57.540] Apktool version: 2.3.3

[11:23:57.540] java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

[11:24:02.949] Updater: v2.1.0

[11:24:08.752] Unpacking "C:\Users\SpiderWeb\Desktop\MIUI Camera_1.apk"
[11:24:08.752] Output directory: "C:\Users\SpiderWeb\AppData\Local\Temp/apk-icon-editor/"
[11:24:13.728] Added application icon: "C:/Users/SpiderWeb/AppData/Local/Temp/apk-icon-editor//apk//res/mipmap-hdpi-v4/ic_launcher_camera.png"
[11:24:13.730] Added application icon: "C:/Users/SpiderWeb/AppData/Local/Temp/apk-icon-editor//apk//res/mipmap-xhdpi-v4/ic_launcher_camera.png"
[11:24:13.732] Added application icon: "C:/Users/SpiderWeb/AppData/Local/Temp/apk-icon-editor//apk//res/mipmap-xxhdpi-v4/ic_launcher_camera.png"
[11:24:13.734] Added application icon: "C:/Users/SpiderWeb/AppData/Local/Temp/apk-icon-editor//apk//res/mipmap-xxxhdpi-v4/ic_launcher_camera.png"
[11:24:13.734] Done.

[11:25:07.783]
--- Packing APK ---
[11:25:07.783] Output file: "C:/Users/SpiderWeb/Desktop/camera.apk"
[11:25:07.783] Contents directory: "C:/Users/SpiderWeb/AppData/Local/Temp/apk-icon-editor//apk/"
[11:25:07.783] Sign: true
[11:25:07.783] Zipalign: true
[11:25:07.783] Using Apksigner: true
[11:25:07.783] Using KeyStore: false
[11:25:07.783] PEM found;
[11:25:07.784] PK8 found;
[11:25:08.486] "Exception in thread "main" java.lang.NumberFormatException: For input string: "@integer/targe_sdk_version"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at brut.androlib.res.AndrolibResources.mapSdkShorthandToVersion(AndrolibResources.java:630)
at brut.androlib.res.AndrolibResources.checkTargetSdkVersionBounds(AndrolibResources.java:310)
at brut.androlib.res.AndrolibResources.aapt1Package(AndrolibResources.java:506)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:597)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:479)
at brut.androlib.Androlib.buildResources(Androlib.java:424)
at brut.androlib.Androlib.build(Androlib.java:303)
at brut.androlib.Androlib.build(Androlib.java:267)
at brut.apktool.Main.cmdBuild(Main.java:238)
at brut.apktool.Main.main(Main.java:76)
"
[11:25:08.486] Error (): Apktool Error

There's a few items that I'm not sure about but, first of all you only really need JRE (It doesn't hurt to have JDK installed either).

Do you have older/other versions of JRE installed? Many individuals install the latest version without realizing that the new versions doesn't update the older ones but, results in each version being installed individually.

The second thing I was wondering about was the mentioning of the term "Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)".

Do you have something like Microsoft Hyper-V installed?

Thanks! :-)

~Ibuprophen

Uh, I'm not sure, but I think VM is Virtual Machine right? I used VMWare some months back so it probably installed Hyper-V.
The other thing is, I had JRE 6 or 7 installed before installing the 8th. (I think it's the latter)

Hey, thank you for the reply!

The reason that I had ask about your using the "Microsoft Hyper-V" is because it doesn't have a GUI (Graphical User Interface). This can/may cause issues with software that requires certain dependencies like "explorer.exe" because that software doesn't come with it.

Regarding the previous JRE installations...

I've found that first uninstalling ALL the JRE software, reboot the PC, and then installing the last/latest version sometimes resolves certain issues.

~Ibuprophen

@SpodermanHu3
I see that you're trying to repack MIUI Camera application.
AFAIK, unfortunately Apktool does not support MIUI.