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

后端 未结 17 834
悲哀的现实
悲哀的现实 2020-12-07 12:00

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 meani

相关标签:
17条回答
  • 2020-12-07 12:40

    Try removing Instant run from settings and gradle will good to go.

    It worked for me.

    0 讨论(0)
  • 2020-12-07 12:41

    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.

    0 讨论(0)
  • 2020-12-07 12:41

    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

    0 讨论(0)
  • 2020-12-07 12:41

    Adding another answer for those who could not remove Instant App Provision, because it keeps reappearing.

    Build the project manually: ./gradlew assembleDebug

    It is a hotfix, but it will work (because the issue is probably related to Android Studio).

    0 讨论(0)
  • 2020-12-07 12:42

    What actually helped for me is adding this

    kapt {
         generateStubs = true
    }
    

    into build.gradle

    0 讨论(0)
提交回复
热议问题