не удается разрешить зависимость Android Studio - PullRequest
0 голосов
/ 12 октября 2019

я просто хочу узнать, как успешно построить плагин

ОШИБКА : Невозможно разрешить зависимость для ': app @ debugAndroidTest / compileClasspath': не удалось разрешить androidx.core: core: 1.1.0. Показать подробности Затрагиваемые модули: приложение

**

build.gradle: проект

**

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

buildscript {
    repositories {
        google()
        jcenter()

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

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

build.gradle: module: app

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "android.example.com"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation "com.android.support:support-v4:28.0.0"
    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.android.support:support-vector-drawable:28.0.0"
    implementation "com.android.support:recyclerview-v7:28.0.0"
    implementation "com.android.support:design:28.0.0"
    implementation "com.android.support.constraint:constraint-layout:1.1.3"
    implementation 'com.android.support:support-annotations:28.0.0'

    implementation 'com.jakewharton:butterknife:10.0.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'


}

Я просто хочу узнать, как успешно подключить плагин для сборки

1 Ответ

0 голосов
/ 12 октября 2019

В Android Studio 3.2 и выше вы можете перенести существующий проект в AndroidX, выбрав Refactor> Migrate to AndroidX в строке меню.

Команда refactor использует два флага,По умолчанию для обоих файлов установлено значение true в вашем файле gradle.properties:

android.useAndroidX=true

Плагин Android использует соответствующую библиотеку AndroidX вместо библиотеки поддержки.

android.enableJetifier=true

Плагин Android автоматически переносит существующие сторонние библиотеки для использования AndroidX, переписывая их двоичные файлы.

Подробности здесь: https://developer.android.com/jetpack/androidx/migrate

...