question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception in thread "main" java.lang.NullPointerException

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
iBotPeachescommented, Aug 17, 2019

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

1reaction
iBotPeachescommented, Nov 30, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I solve Exception in thread "main" java.lang ...
This exception means there's a variable with null value being used. How to solve? Just make sure the variable is not null before...
Read more >
Java NullPointerException - Detect, Fix, and Best Practices
Detecting NullPointerException is very easy, just look at the exception trace and it will show you the class name and line number of...
Read more >
How to resolve the java.lang.NullPointerException - Educative.io
In Java, the java.lang.NullPointerException is thrown when a reference variable is accessed (or de-referenced) and is not pointing to any object.
Read more >
3 Fixes For The "exception in thread "main" java.lang ...
The exception in thread “main”java.lang.nullpointerexception error is an error or an exception which comes about when you try to conduct an ...
Read more >
[Solved] Exception in thread "main" java.lang ... - Java2Blog
Reasons for NullPointerException · Invoking the instance method of a null object. · Accessing or modifying the field of a null object. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found