Получение ошибок при запуске приложения из-за зависимостей - PullRequest
0 голосов
/ 16 апреля 2020

Я получаю ошибки при сборке или запуске приложения на эмуляторе

FAILURE: сборка не удалась с исключением.

  • Что пошло не так: возможно не определить зависимости задачи ': app: compileDebugJavaWith Javac'.

    Не удалось разрешить все зависимости задачи для конфигурации ': app: debugAnnotationProcessorClasspath'. Не удалось найти com.github.bumptech.glide: compile: 4.11.0. Поиск в следующих местах:

    Требуется: project: app

    Не удалось найти com.jakewharton: butterknife-compile: 10.2.1.

    • file: / C: / Users / Noel / AndroidStudioProjects / EBawarchi7 / app / node_modules / response-native / android / com / jakewharton / butterknife-compile / 10.2.1 / butterknife-compile-10.2 Файл compile-10.2.1.jar Требуется: project: app
  • Try: Запустите с параметром --stacktrace, чтобы получить трассировку стека. Запустите с параметром --info или --debug, чтобы получить больше вывода журнала. Запустите --scan, чтобы получить полную информацию.

  • Получите дополнительную помощь по https://help.gradle.org

BUILD FAILED in 25s

Мой Gradle (приложение)

    apply plugin: 'com.android.application'
    apply plugin: 'io.fabric'

    android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.e_bawarchi"
        minSdkVersion 21
        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.appcompat:appcompat:1.1.0'

    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.firebase:firebase-database:19.2.1'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment:2.2.1'
    implementation 'androidx.navigation:navigation-ui:2.2.1'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'com.asksira.android:loopingviewpager:1.1.4'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compile:4.11.0'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.jakewharton:butterknife:10.2.1'
    annotationProcessor 'com.jakewharton:butterknife-compile:10.2.1'
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.basgeekball:awesome-validation:4.2'

    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
}        
    apply plugin: 'com.google.gms.google-services'

Мой проект Gradle

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

    buildscript {

    repositories {
        google()
        maven { url 'http://maven.google.com' }
        maven { url 'https://jitpack.io' }
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://repo1.maven.org/maven2/'}
        maven { url 'https://jcenter.bintray.com/'}
        maven { url '$rootDir/../node_modules/react-native/android'}
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.2'
        classpath 'com.google.gms:google-services:4.3.3'
        classpath 'io.fabric.tools:gradle:1.31.2'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

    allprojects {
        repositories {
            google()
            maven { url 'https://jitpack.io' }
            maven { url 'http://maven.google.com'}
            maven { url 'https://maven.fabric.io/public' }
            maven { url 'https://repo1.maven.org/maven2/'}
            maven { url 'https://jcenter.bintray.com/'}
            maven { url '$rootDir/../node_modules/react-native/android'}
            jcenter()

    }
}

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

Я не могу решить эту проблему, потому что я новичок в Android студия

1 Ответ

0 голосов
/ 16 апреля 2020

Попробуйте добавить mavenCentral() в свои репозитории на уровне проекта build.gradle файл.

repositories {
  mavenCentral()
  google()
  ......
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...