Sneh Pandya
Sneh Pandya

Reputation: 8483

Android Studio 3.1 Gradle Plugin 4.4 KotlinNullPointerException

Surprisingly, my project is completely written and developed in Java only, it's also not containing any dependencies declared for Kotlin. Yet I'm receiving this weird error:

A problem occurred configuring project ':app'.

Configuration:

When I use the below configuration, it works perfectly fine, builds the project and the app gets installed on my device/emulator:

Android Studio Version: 3.1 Stable release

Gradle Plugin Version: 3.0.1

Gradle Distribution URL:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

BUT When I use the latest configuration declared below, the error occurs while running the app as shown in the images:

Android Studio Version: 3.1 Stable release

Gradle Plugin Version: 3.1.0

Gradle Distribution URL:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Steps I've followed/things I've tried:

  1. Clean Project
  2. Rebuild Project
  3. Sync Project
  4. Deleting build folder from project tree
  5. Checked that project doesn't contain any names, references or declarations missing
  6. Invalidate Caches/Restart
  7. Check the whole dependency tree to make sure any Kotlin dependency is not imported or used as my project doesn't make use of Kotlin language

None of the above have worked!

Upvotes: 3

Views: 2531

Answers (2)

velraj
velraj

Reputation: 261

Try to update Android Studio. Turn off Instant Run from Settings → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run.

Upvotes: 0

Ravindra Shekhawat
Ravindra Shekhawat

Reputation: 4353

I think instant run might be creating issue .

Do one thing disable instant run in android studio and try again .I think it might will resolve issue .

Upvotes: 1

Related Questions