in Code

[CODING/SOLVED] gradle build (android) breaks after upgrading a dependency with NullPointerException thrown at ProgramClass.constantPoolEntryAccept

You’ve just upgraded one of your Android project’s dependencies and when you ./gradlew assembleRelease the build process breaks.

You invoke it again with --stacktrace to find the following exception:


[pastacode lang=”java” manual=”java.lang.NullPointerException%0Aat%20proguard.classfile.ProgramClass.constantPoolEntryAccept(” message=”” highlight=”” provider=”manual”/]

This is a ProGuard bug, which my friend, has been solved by the ProGuard team ages ago, and your build environment is using an old ProGuard version.

Add this to your build.gradle to force it to use the latest version (as of today it’s 6.2.2, check the latest version here)

[pastacode lang=”java” manual=”buildscript%20%7B%0A%20%20%20%20…%0A%20%20%20%20dependencies%20%7B%0A%20%20%20%20%20%20%20%20…%0A%20%20%20%20%20%20%20%20classpath%20’net.sf.proguard%3Aproguard-gradle%3A6.2.2’%0A%20%20%7D%0A%7D%0A%7D” message=”force a newer proguard version for your android build” highlight=”1,3,5″ provider=”manual”/]

Write a Comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.