android - 我在使用最新的Android Studio Gradle Update 3.3.1时遇到问题

标签 android gradle warnings

我最近已切换到classpath 'com.android.tools.build:gradle:3.3.1',并且包装器属性设置为distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

我正在使用以下依赖项:

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:multidex:1.0.2'
    implementation "com.google.android.gms:play-services-maps:$playServicesVersion"
    implementation "com.google.android.gms:play-services-gcm:$playServicesVersion"
    implementation "com.google.android.gms:play-services-location:$playServicesVersion"
    implementation "com.google.firebase:firebase-messaging:$playServicesVersion"
    implementation 'com.roomorama:caldroid:3.0.0'
    implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
    implementation "com.android.support:design:$supportLibraryVersion"
    implementation "com.android.support:recyclerview-v7:$supportLibraryVersion"
    implementation "com.android.support:cardview-v7:$supportLibraryVersion"
    implementation "com.jakewharton:butterknife:$butterknife"
    annotationProcessor "com.jakewharton:butterknife-compiler:$butterknife"
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    // retrofit dependency
    implementation "com.squareup.retrofit2:retrofit:$retrofit"
    implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
    implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2'

    // rx dependency
    implementation 'io.reactivex:rxandroid:1.2.1'
    implementation 'io.reactivex:rxjava:1.3.4'

    // network client api
    implementation "com.squareup.okhttp3:okhttp:$okhttp"
    implementation "com.squareup.okhttp3:logging-interceptor:$okhttp"

    //DI dependency
    compileOnly 'javax.annotation:jsr250-api:1.0'
    implementation 'de.hdodenhof:circleimageview:2.0.0'
    implementation 'com.kbeanie:image-chooser-library:1.6.0@aar'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
        transitive = true
    }
    implementation 'pl.charmas.android:android-reactive-location2:2.1@aar'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit"
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
}

并且版本号指定如下:
ext {
    minSdkVersion = 14
    targetSdkVersion = 22
    compileSdkVersion = 27
    supportLibraryVersion = '27.1.1'
    playServicesVersion = '12.0.0'
    versionCode = 12
    versionName = "1.74"
    butterknife = "8.8.1"
    retrofit = "2.2.0"
    okhttp = "3.7.0"
    dragger = "2.12"
}

我收到这些警告,可能是由于ButterKnife [ButterKnife也与AndroidX不兼容]:
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
API 'variantOutput.getProcessManifest()' is obsolete and has been replaced with 'variantOutput.getProcessManifestProvider()'.
API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'. 
API 'variant.getMergeAssets()' is obsolete and has been replaced with 'variant.getMergeAssetsProvider()'.   
API 'variant.getPackageApplication()' is obsolete and has been replaced with 'variant.getPackageApplicationProvider()'. 
API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.

我的查询是,是否有非常严重的事情,还是应该忽略?

最佳答案

我建议您回滚到以前的Gradle版本。这些实际上不仅仅是警告,因为它们可能会影响代码编辑器并阻止您搜索对类的引用。

只需等到相关库更新即可。

关于android - 我在使用最新的Android Studio Gradle Update 3.3.1时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54803674/

相关文章:

基于 Kotlin 的 Gradle 脚本的 Android Lint 失败

c++ - 递归函数抛出非空函数结束警告

android - 无法实例化Android Studio中的一个或多个类

android - 如何发送带有参数的 getForObject 请求 Spring MVC

Android - 获取分配的内存

android - 删除 kotlin-android-extensions 插件后 Gradle 不同步

java - 同一个库的多个版本

windows - Powershell 警告和错误处理

swift - 包加载 : "Ignoring duplicate product" (SwiftPM)

java - 如何获取在另一种方法中定义的编辑文本的值?