я не могу установить библиотеку androidx.preference - PullRequest
0 голосов
/ 25 февраля 2020

Я хочу установить библиотеку предпочтений от Android. когда я go в структуру проекта, чтобы добавить эту библиотеку: 1. У меня нет версии 1.1.0. У меня есть только версии 1.1.0-alpha05 и 1.0.0. 2. когда я хочу установить любую версию этой библиотеки, я получаю: ОШИБКА: не удалось разрешить: androidx.preference: preference: VERSION

** У меня нет таких проблем с другими библиотеками

это мой модуль gradle (приложения):

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.example.notebook_v2"
        minSdkVersion 19
        targetSdkVersion 29
        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 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'androidx.appcompat:appcompat:1.0.2'

}

и это модуль gradle (проекта):

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

buildscript {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }


    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'

        // 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
}

1 Ответ

0 голосов
/ 25 февраля 2020

Попробуйте реализовать это

implementation 'androidx.preference:preference:1.1.0'

И, возможно, вам понадобится обновить инструменты сборки

...