已弃用的 Gradle 功能使其与 Gradle 5.0 不兼容.安卓工作室 3.2 [英] Deprecated Gradle features making it incompatible with Gradle 5.0. Android Studio 3.2

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

问题描述

我的 android 应用程序 Gradle 构建没有同步,因为我将我的 android studio 更新到 3.2.我已经更新了依赖项中的所有内容,但仍然出现相同的错误.这是我使用的依赖文件(包括第三方库)

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.

就我而言(例如),我刚刚在 settings.gradle 文件中添加了 enableFeaturePreview('STABLE_PUBLISHING') 设置,这很神奇(我正在使用 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 不兼容.安卓工作室 3.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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