1

I'm writing a new application and I'm using AndroidX since it seems the best way to go from now on.

I've been having some trouble trying to get MDC and AndroidX together, and although I'm not using any old Support Library dependency I keep getting errors about the android.support.v4.* namespace.

These are my package level build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    ext {
        constraintLayoutVersion = '1.1.2'
        androidxVersion = '1.0.0-rc01'
        drawerlayoutVersion = '1.0.0-alpha1'
        espressoVersion = '3.1.0-alpha1'
        gradleVersion = '3.1.4'
        junitVersion = '4.12'
        kotlinVersion = '1.2.61'
        lifecycleVersion = '2.0.0-rc01'
        navigationVersion = '1.0.0-alpha05'
        roomVersion = '2.0.0-rc01'
        runnerVersion = '1.1.0-alpha1'
    }

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$gradleVersion"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

my module level build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 28
    dataBinding {
        enabled = true
    }
    defaultConfig {
        applicationId "com.example.goodold.openartmap"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "0.0.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix ".debug"
            debuggable true
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation "androidx.core:core-ktx:$rootProject.androidxVersion" //Support Library
    implementation "androidx.fragment:fragment-ktx:$rootProject.androidxVersion" //KTX Fragments
    implementation "androidx.appcompat:appcompat:$rootProject.androidxVersion"
    implementation "androidx.recyclerview:recyclerview:$rootProject.androidxVersion"
    implementation "com.google.android.material:material:$rootProject.androidxVersion"
    //Material Design Library

    implementation "androidx.room:room-runtime:$rootProject.roomVersion" // Room components
    kapt "androidx.room:room-compiler:$rootProject.roomVersion"

    implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"
    // LiveData + ViewModel
    kapt "androidx.lifecycle:lifecycle-compiler:$rootProject.lifecycleVersion"

    implementation "androidx.drawerlayout:drawerlayout:$rootProject.drawerlayoutVersion"
    implementation "androidx.constraintlayout:constraintlayout:$rootProject.constraintLayoutVersion"

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$rootProject.kotlinVersion"

    testImplementation "junit:junit:$rootProject.junitVersion"
    androidTestImplementation "androidx.room:room-testing:$rootProject.roomVersion"
    androidTestImplementation "androidx.test:runner:$rootProject.runnerVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.espressoVersion"
}

and my gradle.properties:

org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true

What am I missing?

0 Answers0