Тип программы уже представлен - библиотека компонентов материалов дизайна и AndroidX - PullRequest
0 голосов
/ 24 августа 2018

Я пишу новое приложение и использую AndroidX, так как с этого момента, кажется, это лучший способ.

У меня возникли некоторые проблемы при попытке получить MDC иAndroidX вместе, и хотя я не использую какую-либо старую зависимость библиотеки поддержки, я продолжаю получать ошибки о android.support.v4.* пространстве имен.

Это мой пакет уровень 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
}

мой модуль уровень 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"
}

и мой gradle.properties:

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

Чего мне не хватает?

...