Apktool: Exception in thread "main" java.lang.NullPointerException

Information

  1. Apktool Version (apktool -version) - 2.4.0 & 2.4.1-75e4c6-SNAPSHOT
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - Playstore

Stacktrace/Logcat

$ java -jar apktool_2.4.0.jar d JioSaavn_6.4.1.apk
I: Using Apktool 2.4.0 on JioSaavn_6.4.1.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/surendra/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" java.lang.NullPointerException
	at brut.androlib.res.data.value.ResEnumAttr.serializeBody(ResEnumAttr.java:56)
	at brut.androlib.res.data.value.ResAttr.serializeToResValuesXml(ResAttr.java:64)
	at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:704)
	at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:263)
	at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:124)
	at brut.apktool.Main.cmdDecode(Main.java:167)
	at brut.apktool.Main.main(Main.java:76)
Process exited with code 1.

$ java -jar Apktool/brut.apktool/apktool-cli/build/libs/apktool-cli-all.jar d JioSaavn_6.4.1.apk
I: Using Apktool 2.4.1-75e4c6-SNAPSHOT on JioSaavn_6.4.1.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/surendra/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
Exception in thread "main" java.lang.NullPointerException
	at brut.androlib.res.data.value.ResEnumAttr.serializeBody(ResEnumAttr.java:56)
	at brut.androlib.res.data.value.ResAttr.serializeToResValuesXml(ResAttr.java:64)
	at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:703)
	at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:260)
	at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:131)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:124)
	at brut.apktool.Main.cmdDecode(Main.java:170)
	at brut.apktool.Main.main(Main.java:76)
Process exited with code 1.

Steps to Reproduce

  1. $ java -jar apktool_2.4.0.jar d JioSaavn_6.4.1.apk

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (.apks that live in /system/framework or /system/priv-app) NA

APK

If this APK can be freely shared, please upload/attach a link to it. JioSaavn

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? YES
  2. If you are trying to install a modified apk, did you resign it? NA
  3. Are you using the latest apktool version? YES

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Confirmed. I can replicate the issue. Thanks for following issue template and attaching sample application.

@iBotPeaches my bad. I was passing the wrong dir. But yes, it fails to build with both aapt1 and aapt2. Should I open another issue for that?

I would investigate those first, if those are warnings because aapt2 is more restrictive then probably not. If it appears that it should be working, then sure. We should investigate.

This will be fixed in v2.5.0

➜  2146 apktool d com.jio.media.jiobeats_215_apps.evozi.com.apk -f
I: Using Apktool 2.4.2-f545c2-SNAPSHOT on com.jio.media.jiobeats_215_apps.evozi.com.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
➜  2146 

Closing.