Why are “third-party third-party Gradle plugins likely to be the cause”, showing after upgrading Gradle to 3.1.0?

After upgrading Gradle to com.android.tools.build:gradle:3.1.0 in the log, I now see:

Folder E: \ Work \ App \ car_android \ carapp \ build \ generated \ source \ kaptKotlin \ devRelease

Third-Party Gradle Plugins May Cause

+25
source share
5 answers

If you get a warning:

These may be third-party Gradle plugins.

the build tab seems to be a known issue with Android Studio v3.1.x.
According to this report, this may be due to the provision of instant applications, but even removing it from the start / debug configuration does not seem to fix the problem (at least not with my installation of AS v3.1.1).

Please vote for this issue to pay more attention to the Android Studio team and, I hope, a timely fix.

+17
source

It worked in my project! →

Your build.gradle project should look like this: enter image description here

Note. It may be a little different if you are not using Realm and some Google services.

enter image description here

  • Now, let's start → Go to you build.gradle App

Android-oriented platform modules Updating experimental multi-platform projects includes support for Android platform modules. These modules should use the appropriate plugin in the Gradle build script and use the common code from the general module:

  • You will copy this inside your build.gradle ON THE TOP ADD IT -

Kapt Diagnostics Location At the moment, kapt, the Kotlin annotation processing tool, may offer location references in the Kotlin source code, rather than generated Java stubs, as it reports errors encountered while processing annotations. You can enable this function by adding these lines to the Gradle build script (build.gradle) construct:

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

2. NOW ADD THIS:

 kapt { mapDiagnosticLocations = true } dataBinding { enabled = true } 

Improvements to the IntelliJ IDEA Kotlin plugin 1.2.30 offers various improvements to the IntelliJ IDEA Kotlin plugin, including performance improvements, bug fixes, and new checks and intentions.

For some projects this is important: you copy this inside your build.gradle -

  allprojects { repositories { jcenter() google() } 

It will look as follows

Now we need to add implementations inside the dependencies { ... // } build.gradle:

 // 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" 

* * *

  • Clean up project
  • Build it
  • What is it!

More info: Android site :) Let me know if this works! (If this does not work, I try to help you find the best way)

+1
source

This is because the Kapt annotation handler uses this directory to store files created by Kotlin.

The directory is a new generated source set, just as you can split the source files into src/main/java and src/main/kotlin

However, the Android Gradle plugin does not recognize this directory as a generated set of sources.

For the most part, this is completely safe, since most third-party processors generate .Java files. Kapt writes them to the build/generated/source/kapt .

+1
source

According to this Android Studio issue, “The root problem with Kapt is that the Kapt resolver in the IDEA from JetBrains registers these folders as“ in an invalid path. ”This is an incorrect use of the API.”

As of 6/11/2018 there is a fix that allows you to double-check these messages and suppress them against paths that are really valid.

0
source

I delete the two folders app \ build \ generated \ source \ kaptKotlin \ debug and app \ build \ generated \ source \ kaptKotlin \ release ("debug" and "release") and adds it to gradle:

 kapt { mapDiagnosticLocations = true } 

then the project is synchronized without problems.

0
source

Source: https://habr.com/ru/post/1276151/


All Articles