ошибка: пакет android .support.annotation не существует - Android studio - Gradle - PullRequest
0 голосов
/ 19 января 2020

build.gradle (Модуль: приложение)

apply plugin: 'com.android.application'
apply plugin: 'com.apollographql.android'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.startup.grandinvit"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {

            //useProguard true
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {

            debuggable true
            //useProguard true
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'


        }
    }
}



dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'androidx.appcompat:appcompat:1.0.2'

    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.1'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    //noinspection GradleCompatible
    implementation 'androidx.appcompat:appcompat:1.0.0'
    testImplementation 'junit:junit:4.12'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.gms:play-services-vision:17.0.2'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0'
    implementation 'com.airbnb.android:lottie:2.0.0-rc1'


    // Check for v11.4.2 or higher
    implementation 'com.google.firebase:firebase-core:16.0.6'

    // Add dependency
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.7'
    //implementation 'org.jetbrains:annotations-java5:15.0'
    //implementation 'org.jetbrains:annotations:16.0.2'

    implementation 'com.apollographql.apollo:apollo-runtime:1.0.0'
    implementation "com.apollographql.apollo:apollo-android-support:1.0.0"

    implementation "androidx.annotation:annotation:1.1.0"
    androidTestImplementation "com.android.support:support-annotations:28.0.0"



}

При сборке проекта появляется ошибка «ошибка: пакет android .support.annotation не существует»

Я попробовал описанные ниже способы ее решения.

  1. В *. java файле, я попытался прокомментировать и добавить импорт снова.

  2. Я попытался добавить добавление "androidx.annotation: annotation: 1.1.0"

, но все равно не повезло.

gradle.properties

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

Заранее спасибо за помощь, я застрял с этим в течение некоторого времени, любая помощь будет высоко оценена.

1 Ответ

0 голосов
/ 19 января 2020

Попробуйте изменить с:

androidTestImplementation "com.android.support:support-annotations:28.0.0"

на

implementation "com.android.support:support-annotations:28.0.0"
...