不推荐使用的Gradle功能使其与Gradle 5.0不兼容. Android Studio 3.2 [英] Deprecated Gradle features making it incompatible with Gradle 5.0. Android Studio 3.2

查看:560
本文介绍了不推荐使用的Gradle功能使其与Gradle 5.0不兼容. Android Studio 3.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My android app Gradle build is not syncing, since I updated my android studio to 3.2. I have updated everything in the dependencies and still getting the same error. Here are the dependency files that I use ( Including third-party libraries)

    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"来显示各个弃用警告.

However, I am getting the following error Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings.

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

I have tried most things available through Google/Youtube searches. Implemented few answers given in StackOverflow too. But at the end of the day, it's the same error. What I am missing.

请咨询,如何解决此问题.谢谢

Please advice, how to resolve the issue. Thank you

推荐答案

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

So the problem doesn't necessarily needs to be in your application level build.gradle script (the one you posted). It can also be in the project level one or even in the maven-publish-aar.gradle one (if you have it). This means, you could be using deprecated Gradle features on any Gradle script.

我已经更新了依赖项中的所有内容,并且仍然遇到相同的错误.

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

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

Most likely, the warning will be gone once you identify and replace any deprecated Gradle feature that's causing you this trouble. To do this, it will help you to actually add the mentioned --warning-mode=all flag to your Gradle command line options (on your Android studio compiler settings):

这样会打印出适当的警告,以提醒您您的应用正在使用的特定不推荐使用的功能.

This will print the proper warnings for you to be aware of what are the specific deprecated features your app is using.

例如,我只是将enableFeaturePreview('STABLE_PUBLISHING')设置添加到settings.gradle文件中,这确实具有魔力(我正在使用publishing{}).

In my case (for example), I just added the enableFeaturePreview('STABLE_PUBLISHING') setting on the settings.gradle file and that did the magic (I'm using publishing{}).

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

Also, I know you asked this near a month ago, but, it might be useful for other people facing the same issue.

这篇关于不推荐使用的Gradle功能使其与Gradle 5.0不兼容. Android Studio 3.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆