代码之家  ›  专栏  ›  技术社区  ›  batsheva

我更新了我的android工作室和gradle到最新的->我不能使用数据绑定

  •  0
  • batsheva  · 技术社区  · 7 年前

    我在app gradle中收到此错误消息:

    未能解析:com.android.databinding:库:3.3.2

    我在另一个问题上看到了,因为在毕业典礼上 我的毕业生不适合

    这是我的应用程序gradle:

    apply plugin: 'com.android.application'
    android {
        compileSdkVersion 25
        buildToolsVersion "25.0.3"
        defaultConfig {
            applicationId "com.ophiropt.meissa"
            minSdkVersion 21
            targetSdkVersion 25
            versionCode 1
            versionName "1.0"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            externalNativeBuild {
                cmake {
                    cppFlags "-std=c++1z -frtti -fexceptions"     }   }
            ndk {
               abiFilters 'armeabi-v7a'   }
            vectorDrawables.useSupportLibrary = true}
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            } }
        externalNativeBuild {
            cmake {
                path "CMakeLists.txt"
            }}
        dataBinding {
            enabled = true }
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES.txt'
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/notice.txt'
            exclude 'META-INF/license.txt'
            exclude 'META-INF/dependencies.txt'
            exclude 'META-INF/LGPL2.1'
        }
    }    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        compile 'com.android.support:appcompat-v7:25.0.1'
        compile 'com.rengwuxian.materialedittext:library:2.1.4'    
        compile 'com.couchbase.lite:couchbase-lite-android:1.2.0'
        compile 'com.google.code.gson:gson:2.6.2'    
        compile "com.android.support:recyclerview-v7:25.0.0"
        compile 'com.android.support:cardview-v7:25.0.0'
        compile 'com.android.support:design:25.0.1'
        compile 'org.greenrobot:eventbus:3.0.0'
        testCompile 'junit:junit:4.12'    
        compile 'com.afollestad.material-dialogs:core:0.9.4.5'       
        compile 'com.elmargomez.typer:typerlib:1.0.0'
        compile (name:'charting-release', ext:'aar')
        compile (name:'drawing-release', ext:'aar')
        compile (name:'data-release', ext:'aar')
        compile (name:'core-release', ext:'aar')    
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
    }
    
    0 回复  |  直到 7 年前
        1
  •  1
  •   Izabela Orlowska    7 年前

    你需要一个 google() 附属国:

    buildscript {
      repositories {
          google() // here
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.3.1'
      }
    } 
    allprojects {
      repositories {
          google() // and here
          jcenter()
    }
    
        2
  •  0
  •   batsheva    7 年前

    我的问题是gradle gradle:3.3.2的sdk最低版本必须是28,而我的问题是25。