batsheva
batsheva

Reputation: 2295

I updated my android studio and gradle to the latest one -> and I can't work with data binding

I get this error message in app Gradle:

Failed to resolve: com.android.databinding:library:3.3.2

I see in another question it because of apt that in the Gradle I don't have apt in my Gradle

Here is my app 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'
}

Upvotes: 0

Views: 263

Answers (2)

batsheva
batsheva

Reputation: 2295

the problem by me was that the minimum SDK version with Gradle gradle:3.3.2 has to be 28 and by me, it is 25

Upvotes: 0

Izabela Orlowska
Izabela Orlowska

Reputation: 7532

You need a google() dependency:

buildscript {
  repositories {
      google() // here
      jcenter()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:3.3.1'
  }
} 
allprojects {
  repositories {
      google() // and here
      jcenter()
}

Upvotes: 1

Related Questions