Студия Android не может собрать мое приложение после обновления подключаемого модуля - PullRequest
3 голосов
/ 21 марта 2019

Я обновил плагин Gradle вчера, и теперь Android-студия не может собрать мое приложение. Приложение показывает следующую ошибку.

    ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app


ERROR: Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve io.grpc:grpc-core:[1.16.1].
Show Details
Affected Modules: app


WARNING: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.
Affected Modules: app

Файл уровня моего приложения build.gradle выглядит так:

    apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.mvp1stockmeter"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    dataBinding
            {
                enabled true
            }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    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:multidex:1.0.3'
    implementation 'org.jsoup:jsoup:1.11.3'

    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-firestore:18.0.0'

    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
    implementation 'com.firebaseui:firebase-ui-auth:4.3.1'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    //implementation 'com.facebook.android:facebook-android-sdk:4.x'

    implementation 'com.jjoe64:graphview:4.2.2'
}
apply plugin: 'com.google.gms.google-services'

Файл моего проекта build.gradle выглядит так:

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

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.26.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
        }
    }
}

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

Я искал это в StackOverflow и в Google. Но не нашел никакой информации. Пожалуйста помоги. Я застрял здесь.

Ответы [ 3 ]

1 голос
/ 23 марта 2019

Понятия не имею, почему это происходит, но это происходит со вчерашнего дня, 21 марта 2019 года. Думаю, это проблема в хранилище maven?Поскольку URL-адрес, по которому android studio пытается получить эту библиотеку, не работает.

В любом случае, исправление заключается в том, чтобы «вручную» указать AS на эту отсутствующую зависимость, добавив эту строку в ваш build.gradle, внутри зависимостей {...}

implementation group: 'io.grpc', name: 'grpc-core', version: '1.16.1'

Затем выполните синхронизацию, затем вы можете удалить эту строку.

Хорошо, я надеюсь, что кто-то может объяснить, что произошло.

0 голосов
/ 21 марта 2019

Добавление mavenCentral () в секцию buildScript {} файла уровня build.gradle решило эту проблему для меня. Спасибо за вашу поддержку.

0 голосов
/ 21 марта 2019

Удалить эту строку: - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" ... Это сработало для меня

...