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

After updating to Android Studio 3.1 I got this error message:

The project works fine and this is mostly just a warning, so my question is what's the meaning of the warning and how can I get rid of it?

The relevant parts from gradle files:

This is my project's build.gradle

buildscript {
    ext {
        kotlin_version = '1.2.31'
        anko_version = '0.10.4'
        room_version = '1.0.0'
        support_version = '27.1.0'
        firebase_version = '12.0.0'
        gms_version = '12.0.0'
    }

    repositories {
        google()
        jcenter()
        maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' }
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' }
    }
}

And this is my app's build.gradle file:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 27
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

Run -> Edit Configurations..

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

Why is "3rd-party Gradle plug-ins may be the cause" showing after , If you are receiving the warning: 3rd-party Gradle plug-ins may be the cause. in the build tab, it appears to be a known issue with Android  Cannot build with Android Studio 3.1 Gradle 4.4: "Failed to resolve: glide 3rd-party Gradle plug-ins may be the cause" #2993 samtipton opened this issue Mar 28, 2018 · 20 comments Labels

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.

3rd-party Gradle plug-ins may be the cause · Issue #70 · android , 3rd-party Gradle plug-ins may be the cause . I re-ordered to: mavenCentral() maven { url 'https://jitpack.io' } google() Why is “3rd-party Gradle plug-ins may be the cause” showing after updating Gradle to 3.1.0? not able to update android studio 3.1: Conflicting configuration:'armeabi-v7a,x86' during sync project ; Gradle sync failed with Android Studio 3.1: Uninitialized object exists on backward branch 70

Cannot build with Android Studio 3.1 Gradle 4.4: "Failed to resolve , Get started. Law Utoo. Follow. May 3, 2018 · 2 min read Android Studio 3.1.2 with Gradle's issue 3rd-party Gradle plug-ins may be the cause. Solution:. Cannot build with Android Studio 3.1 Gradle 4.4: "Failed to resolve: glide 3rd-party Gradle plug-ins may be the cause" #2993 Closed This comment has been minimized.

at android studio v3.1.2 , happen Error:

Folder D:\AndroidProjects\app\build\generated\source\kaptKotlin\debug
Folder D:\AndroidProjects\app\build\generated\source\kaptKotlin\release
3rd-party Gradle plug-ins may be the cause

because dataBinding use apply plugin: 'kotlin-kapt' so add

kapt {
    generateStubs = true
}
  1. Change gradle plugin version to 3.1.2
  2. Change Kotlin version to 1.2.30
  3. Then Android studio changed gradle wrapper to version 4.4
  4. Then Android studio was saying that the build tools version used was 27.1.1 and that I should change it to 27.1.1 so I also changed the target SDK to 27

3rd party Gradle plug ins may be the cause, 3rd-party Gradle plug-ins may be the cause. Because dataBinding took apply plugin: 'kotlin-kapt' So you want to add kapt { generateStubs = true }. After the  INFO: 3rd-party Gradle plug-ins may be the cause WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. It will be removed at the end of 2019.

Here are some steps that I've followed. In my case it's fixed the issue!

Platform modules targeting Android The update of the experimental multiplatform projects feature introduces support for Android platform modules. These modules should apply the corresponding plugin in the Gradle build script and can use the shared code from a common module:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-platform-android'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
// ...
// ...

Kapt diagnostic locations As of now, kapt, the Kotlin annotation processing tool, can offer links to locations in the original Kotlin code rather than generated Java stubs as it reports errors encountered during annotation processing. You can enable this feature by adding these lines to the Gradle build script (build.gradle):

kapt {
    mapDiagnosticLocations = true
}

Add this:

allprojects {
        repositories {
            jcenter()
            google()
        }
    }

Don't forget the next:

// Architecture Component - Room

     implementation "android.arch.persistence.room:runtime:1.1.0-beta1"
        kapt "android.arch.persistence.room:compiler:1.1.0-beta1"

      // Lifecyles, LiveData and ViewModel
    kapt 'com.android.databinding:compiler:3.1.0'


 // ViewModel and LiveData
    implementation "android.arch.lifecycle:extensions:1.1.1"

// alternatively, just ViewModel
    implementation "android.arch.lifecycle:viewmodel:1.1.1"

 // alternatively, just LiveData
     implementation "android.arch.lifecycle:livedata:1.1.1"
       kapt "android.arch.lifecycle:compiler:1.1.1"

 // Room (use 1.1.0-beta1 for latest beta)
    implementation "android.arch.persistence.room:runtime:1.0.0"
      kapt "android.arch.persistence.room:compiler:1.0.0"


// Paging
    implementation "android.arch.paging:runtime:1.0.0-alpha7"

        // Test helpers for LiveData
    testImplementation "android.arch.core:core-testing:1.1.1"

        // Test helpers for Room
 testImplementation "android.arch.persistence.room:testing:1.0.0"
  1. Clean your project

  2. Build and That's it!

Add all of this, Clean your project, build and That's it! :) Let me know if this works! (If it is not working for you, I will help you with another solution)

More Info: Android Site :) Let me know if it works! (If it does not work, I will try to help you finding a better way)

If you give a downVote explain why

Android Studio + kapt plugin = gradle sync warnings, 1252 What's the difference between implementation and compile in Gradle? 132 3rd-party Gradle plug-ins may be the cause; 103 Error:Execution failed for task ':app

Android studio 3.1.2 common issue (by far) - Law Utoo, Incompatible with Android Gradle plugin v1.5.0 #34. They mentioned working on API's to allow 3rd party languages (esp Kotlin) to hook into the build system and

3rd-party Gradle plug-ins may be the cause, Using the plugins DSL: plugins { id "org.jetbrains.kotlin.kapt" version "1.3.72" } Using legacy plugin application: buildscript { repositories { maven { url "https

MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26) failed to resolve glide, now 3rd-party Gradle plug-ins may be the cause via   Stack Overflow   by   Lalit Jadav,  2 years ago http://stackoverflow.com/questions/49532845

Comments
  • according to issuetracker.google.com/issues/74537216 this issue is fixed in AS3.2
  • Build > Rebuild Project worked from me
  • this actually works but any idea why it was happening and how you arrived at this solution.
  • and for some reason after deleting Instant App Provisions it always returning to its place.
  • Not working. Are there any other ways?
  • @Caleb_Allen no, but nobody uses instant run anyway. This is for 'instant apps', not instant run
  • For anyone where this keeps on coming back (like @humazed), I found a fix: First go to Run > Edit Configurations again. Then go to Edit Defaults by clicking the button with the wrench icon at the top. Select Android App and leave only Gradle-aware Make like before. Hit apply.
  • But I still cant run my app as it will build the project before launching it.
  • Build > Rebuild Project worked for me!
  • Adding the line mapDiagnosticLocations = true to kapt configuration works - well sometimes at least :/
  • @kuhnroyal I appreaciate your feedback! Have a nice day, I keep searching for a better solution