【问题标题】:Unable to update the gradle version for particular project : Android Studio无法更新特定项目的 gradle 版本:Android Studio
【发布时间】:2019-11-01 04:45:42
【问题描述】:

我正在使用以下版本 安卓工作室:3.5.1

classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'me.tatarka:gradle-retrolambda:3.7.1'

project.ext.minSdkVersion = 21
project.ext.compileSdkVersion = 27
project.ext.buildToolsVersion = '27.0.3'
project.ext.supportLibVersion = '27.0.0'

在应用程序中

dataBinding {
        enabled = true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

和 gradle wrapper 属性是:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

现在我想更新项目 gradle。

classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'me.tatarka:gradle-retrolambda:3.7.1'// we cannot use it for gradle updated versions 

project.ext.minSdkVersion = 21
project.ext.compileSdkVersion = 28
project.ext.buildToolsVersion = '28.0.2'
project.ext.supportLibVersion = '28.0.0'

这里显示了删除retrolambda的错误,显示了影响项目的lambda方法的compileOptions remove。

每当我尝试仅更新 3.0.0 的 gradle 版本而没有任何其他项目 ext 更新时,它都会向我显示绑定错误 BR。

请检查 gradle 中的所有依赖项。

dependencies {
    //    testCompile 'junit:junit:4.12'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:$rootProject.supportLibVersion"
    compile "com.android.support:support-v4:$rootProject.supportLibVersion"
    compile "com.android.support:recyclerview-v7:$rootProject.supportLibVersion"
    compile "com.android.support:cardview-v7:$rootProject.supportLibVersion"
    compile "com.android.support:customtabs:$rootProject.supportLibVersion"
    compile "com.android.support:design:$rootProject.supportLibVersion"
    //mvp library
    compile 'de.appsfactory:mvp:2.+'
    //date and time joda library
    compile 'net.danlew:android.joda:2.10.3'
    compile 'com.shawnlin:number-picker:2.4.2'
    compile 'net.hockeyapp.android:HockeySDK:5.2.0'
    compile 'org.greenrobot:greendao:3.2.2'
    compile 'com.reginald.swiperefresh:library:1.1.2'
    compile 'io.swagger:swagger-annotations:1.5.24'
    compile 'net.openid:appauth:0.7.0'//unable to update 0.7.1
    //dynamically dimensions library
    compile 'com.intuit.sdp:sdp-android:1.0.5'
    compile 'com.google.guava:guava:24.1-android'//unable to update 24.1-jre
    compile 'com.google.android.gms:play-services-auth:16.0.1'
    compile 'com.google.android.gms:play-services-fitness:16.0.1'

    //multidex
    compile 'com.android.support:multidex:1.0.3'
    compile 'com.wrbug:editspinner:1.1.0'

    compile('cn.trinea.android.view.autoscrollviewpager:android-auto-scroll-view-pager:1.1.2') {
        exclude module: 'support-v4'
    }
    compile 'org.jsoup:jsoup:1.10.2'
    //rxble library
    compile 'com.polidea.rxandroidble2:rxandroidble:1.10.3'
    compile 'io.reactivex.rxjava2:rxjava:2.2.8'
    compile 'io.reactivex.rxjava2:rxandroid:2.1.0'
    compile 'com.jakewharton.rx2:replaying-share:2.1.0'
    compile 'com.google.android.gms:play-services-base:16.1.0'

    //photo libraries
    compile 'com.github.chrisbanes:PhotoView:2.1.3'
    compile 'com.github.bumptech.glide:glide:3.8.0'

    compile 'com.google.code.gson:gson:2.8.2'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'de.hdodenhof:circleimageview:3.0.0'


}

我收到如下错误: 错误:com.android.databinding.library.baseAdapters 包不存在 错误:找不到符号类 BR

【问题讨论】:

  • 你能用错误屏幕更新问题吗
  • 请检查错误画面。
  • 您是否尝试过清理并重建项目?@porwalshweta24
  • 尝试文件->使缓存无效/重新启动
  • 是的,我已经这样做了,但不适合我。索汉姆和沙龙

标签: android java-8 build build.gradle retrolambda


【解决方案1】:

请试试这个解决方案:

项目分级。

dependencies {
     classpath 'com.android.tools.build:gradle:3.3.2'
 }

【讨论】:

  • 我收到 BR 错误并出现此错误:com.android.databinding.library.baseAdapters 包不存在。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多