ProGuard throwing NullPointerException during obfuscation

When I’m running proguard on my jar file, I get a nullpointerexception in ProgramClass#getTag line 265.

java.lang.NullPointerException
	at proguard.classfile.ProgramClass.getTag(ProgramClass.java:265)
	at proguard.classfile.util.InstructionSequenceMatcher.matchingConstantIndices(InstructionSequenceMatcher.java:682)
	at proguard.classfile.util.InstructionSequenceMatcher.visitConstantInstruction(InstructionSequenceMatcher.java:304)
	at proguard.classfile.instruction.ConstantInstruction.accept(ConstantInstruction.java:154)
	at proguard.classfile.util.DynamicClassReferenceInitializer.visitAnyInstruction(DynamicClassReferenceInitializer.java:242)
	at proguard.classfile.instruction.visitor.InstructionVisitor.visitConstantInstruction(InstructionVisitor.java:57)
	at proguard.classfile.instruction.ConstantInstruction.accept(ConstantInstruction.java:154)
	at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:175)
	at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:147)
	at proguard.classfile.instruction.visitor.AllInstructionVisitor.visitCodeAttribute(AllInstructionVisitor.java:49)
	at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:138)
	at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:148)
	at proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:92)
	at proguard.classfile.visitor.MemberVisitor.visitProgramMethod(MemberVisitor.java:57)
	at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:140)
	at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:695)
	at proguard.classfile.visitor.AllMethodVisitor.visitAnyClass(AllMethodVisitor.java:46)
	at proguard.classfile.visitor.ClassVisitor.visitProgramClass(ClassVisitor.java:40)
	at proguard.classfile.ProgramClass.accept(ProgramClass.java:544)
	at proguard.classfile.ClassPool.classesAccept(ClassPool.java:285)
	at proguard.Initializer.execute(Initializer.java:225)
	at proguard.ProGuard.initialize(ProGuard.java:300)
	at proguard.ProGuard.execute(ProGuard.java:127)
	at proguard.ProGuard.main(ProGuard.java:677)

Is there a way to tell what input class is causing this and try to fix it?

Hi @ThatGamerBlue

Thanks for raising this question as this has come up for a few people recently. If you don’t mind me asking, can you create an issue for this over on GitHub ? If you are able to attach a reproducible sample that would be very helpful for us to resolve faster.

Much appreciated,
Jesse

1 Like