android - 不推荐使用的Gradle功能使其与Gradle 5.0不兼容。 Android Studio 3.2

标签 android android-studio gradle

我的Android应用程式Gradle版本无法同步,因为我将Android Studio更新至3.2。我已经更新了依赖项中的所有内容,但仍然收到相同的错误。这是我使用的依赖文件(包括第三方库)

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

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "myappid"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 32
        versionName "3.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.11"
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.android.support:design:28.0.0-alpha1'
    implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
    implementation 'com.android.support:cardview-v7:28.0.0-alpha1'
    implementation 'com.android.support:support-v4:28.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-crash:28.0.0-alpha1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation "org.jetbrains.anko:anko:$anko_version"
    implementation 'com.github.GrenderG:Toasty:1.2.5'
    implementation 'com.github.scottyab:showhidepasswordedittext:0.8'
    implementation 'com.daimajia.easing:library:2.1@aar'
    implementation 'com.daimajia.androidanimations:library:2.3@aar'
    implementation 'com.google.android.gms:play-services-ads:17.1.2'
    implementation 'com.google.gms:google-services:4.2.0'
    implementation 'com.github.sd6352051:NiftyDialogEffects:v1.0.3'
    implementation 'net.steamcrafted:load-toast:1.0.12'
    implementation 'com.android.support:animated-vector-drawable:28.0.0-alpha1';

}


//apply plugin: 'com.google.gms.google-services'
//classpath 'com.google.gms:google-services:4.2.0'

但是,我收到以下错误
在此版本中使用了不推荐使用的Gradle功能,使其与Gradle 5.0不兼容。
使用“--warning-mode all”来显示各个弃用警告。

我已经尝试了通过Google / Youtube搜索获得的大多数功能。也实现了StackOverflow中给出的一些答案。但归根结底,这是同样的错误。我所缺少的。

请咨询,如何解决该问题。谢谢

最佳答案

因此,问题不一定存在于您的应用程序级别的build.gradle脚本(您发布的脚本)中。它也可以在项目一级,甚至在maven-publish-aar.gradle一级(如果有)。这意味着,您可能在任何Gradle脚本上使用了不赞成使用的Gradle功能。

I have updated everything in the dependencies and still getting the same error.



最有可能的是,一旦您识别并替换了引起您此麻烦的任何不推荐使用的Gradle功能,该警告就会消失。为此,它将帮助您将提到的--warning-mode=all标志实际上添加到Gradle命令行选项中(在Android Studio编译器设置中):

enter image description here
这将为您打印适当的警告,以使您知道应用程序正在使用哪些特定的不赞成使用的功能

就我而言(例如),我只是在settings.gradle文件中添加了enableFeaturePreview('STABLE_PUBLISHING')设置,并且做到了神奇(我使用publishing{})。

另外,我知道您是在一个月前问这个问题的,但是,这对于面临相同问题的其他人可能很有用。

关于android - 不推荐使用的Gradle功能使其与Gradle 5.0不兼容。 Android Studio 3.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57510402/

相关文章:

android - 如何在 Android Studio 中构建 'release' APK?

android - EditText中不能写多行文字

android - Java long计算错误

Android HTTP 请求异步任务

安卓工作室 0.4.2 : Gradle project sync failed error

android - “Gradle error after Android Studio update”

android - 如何在android studio中制作aar

java - 检索文件列表时 it.sauronsoftware.ftp4j.FTPListParseException

gradle - 不同的任务不能有不同的系统属性值

android - 无法更新 android studio 3.1 : Conflicting configuration : 'armeabi-v7a,x86' during sync project