0

I am learning android mvvm tutorial but I am getting following errors from gradle

ERROR: Failed to resolve: androidx.room:room-runtime:1.0.0 Show in Project Structure dialog Affected Modules: app

ERROR: Failed to resolve: org.kodein.di:kodein-di-generic-jvm:1.0.0 Show in Project Structure dialog Affected Modules: app

ERROR: Failed to resolve: org.kodein.di:kodein-di-framework-android-x:1.0.0 Show in Project Structure dialog Affected Modules: app

below my app.gradle

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'
apply plugin: "kotlin-kapt"

apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.forecastmvvm"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.0.0"
    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation "android.arch.navigation:navigation-fragment:1.0.0"
    implementation "android.arch.navigation:navigation-ui:1.0.0"
    implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0"
    implementation "android.arch.navigation:navigation-ui-ktx:1.0.0"

    implementation "androidx.core:core-ktx:1.0.0"
    implementation "androidx.constraintlayout:constraintlayout:1.1.3"

    // Room
    implementation "androidx.room:room-runtime:1.0.0"
    implementation "androidx.legacy:legacy-support-v4:1.0.0"
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0'
    kapt "androidx.room:room-compiler:1.0.0"

    // Gson
    implementation "com.google.code.gson:gson:2.8.5"

    // Kotlin Android Coroutines
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0"

    // Retrofit
    implementation "com.squareup.retrofit2:retrofit:2.0.0"
    implementation "com.squareup.retrofit2:converter-gson:2.0.0"
    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'

    // ViewModel
    implementation "androidx.lifecycle:lifecycle-extensions:1.0.0"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:1.0.0"
    kapt "androidx.lifecycle:lifecycle-compiler:1.0.0"

    // Kodein
    implementation "org.kodein.di:kodein-di-generic-jvm:1.0.0"
    implementation "org.kodein.di:kodein-di-framework-android-x:1.0.0"

    // Better dateTime-time support even on older Android versions
    implementation "com.jakewharton.threetenabp:threetenabp:1.1.0"

    // Glide
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    kapt 'com.github.bumptech.glide:compiler:4.8.0'

    // Groupie RecyclerView
    implementation 'com.xwray:groupie:2.1.0'
    implementation 'com.xwray:groupie-kotlin-android-extensions:2.1.0'

    // Preference
    implementation "androidx.preference:preference:1.0.0"

    // WeatherLocation
    implementation "com.google.android.gms:play-services-location:16.0.0"

    // New Material Design
    implementation "com.google.android.material:material:1.0.0"

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'

below gradle

buildscript {
    ext.kotlin_version = '1.3.41'
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Edgar Shvedskiy
  • 135
  • 3
  • 18

1 Answers1

0

Modify

androidx.room:room-runtime:1.0.0
org.kodein.di:kodein-di-generic-jvm:1.0.0
org.kodein.di:kodein-di-framework-android-x:1.0.0

to

androidx.room:room-runtime:2.1.0
org.kodein.di:kodein-di-generic-jvm:6.3.3
org.kodein.di:kodein-di-framework-android-x:6.3.3

Also, check for other dependencies, you might have entered wrong versions or not the latest one.

Deˣ
  • 4,191
  • 15
  • 24