Android Studio: How to fix error "java.lang.NullPointerException (no error message)"

I try to work with old project that hasn’t been updated years ago. I got an exception without any explanation.


A problem occurred configuring project ':app'.
> java.lang.NullPointerException (no error message)


The error is caused by gradle. Most of the answers I found didn’t help, because whatever I do, it always fails. After hours and hours, I finally found a fix by myself. Change gradle version to latest verison

Assuming you know the latest version of gradle version, open build.gradle (NOT in /app/build.gradle) and change to latest version in the dependencies.






(4.1.2 as of March 2021)

Now Sync, if asked

Image 1614966539.png

You will now get another error about Gradle version, just click the blue text Fix Gradle wrapper and re-import project.

Image 1614966683.png

You should be good to go \o/

Image 1614966894.png

Hope it helps!


Popular Posts

VMOS Pro - FREE Custom ROMs without VIP | GMS, ROOT, Xposed | Android 4.4.4, 5.1.1, 7.1.2, 9.0 ROMs

List of Android Virtual Machine apps for Android devices