java.lang.NullPointerException (no error message) APK building java.lang.NullPointerException (no error message) APK building android android

java.lang.NullPointerException (no error message) APK building


I had the same issue after adding:

compileOptions {    sourceCompatibility JavaVersion.VERSION_1_8    targetCompatibility JavaVersion.VERSION_1_8}

It was because my default java version was 10:

$ java -versionjava version "10.0.1" 2018-04-17

After changing to 1.8 (with sudo update-alternatives --config java) issue was fixed.


I have had the same kind of problem these days. I found it might be caused by the version of gradle. After changing the version to 2.1.0, the problem's gone.

dependencies {        classpath 'com.android.tools.build:gradle:2.1.0'    }

I'm not sure it works for you.


Add this to your app module's build.gradle file:

lintOptions {    checkReleaseBuilds false}