3rd-party Gradle plug-ins may be the cause

What fixed the issue for me:

  • Change gradle plugin version to 3.1.0
  • Change Kotlin version to 1.2.30
  • Then Android studio changed gradle wrapper to version 4.4
  • Then Android studio was saying that the build tools version used was 27.0.3 and that I should change it to 27.0.3 so I also changed the target SDK to 27
  • I added this to my gradle.build:

    kapt {
         generateStubs = true
     }
    

I hope it helps


I restarted Android Studio and the problem disappeared.

Click File -> Invalidate Caches/Restart

Every time I change the gradle file, I must restart Android Studio to or the problem returns.

You can also try this:

  1. Re-ordered repositories to:

    mavenCentral()
    maven { url 'https://jitpack.io' }
    google()
    jcenter()
    
  2. Clearing this folder: user's ~/.gradle/caches and deleting app build folder manually, then clean and rebuild.


To solve the issue, remove Instant App Provision from the "Run Configurations" and leave only the Gradle-Aware Make.

Run -> Edit Configurations..

My Run/Debug configurations after successful build

I have AndroidStudio 3.1, Gradle Plugin 3.1.0 and Kotlin library version 1.2.30.