Подтвердить что ты не робот

Предупреждение об установке Android Studio build.gradle

После того, как я успешно обновился до Android Studio 3.1 Canary 9, я получаю предупреждающее сообщение как

Warning:Configuration 'compile' is obsolete and has been replaced with 'implementation'.
It will be removed at the end of 2018

Я знаю, что это предупреждение не вызовет каких-либо проблем в моем проекте хотя бы пока. Но я хочу полностью удалить его, чтобы в будущем не было никаких проблем. Но после просмотра моего файла build.gradle я не могу найти строку кода, которая вообще вызывала это предупреждение.

Вот мой файл build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "app.project.virtualdiary"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.android.support:support-vector-drawable:27.0.2'
}


apply plugin: 'com.google.gms.google-services'
4b9b3361

Ответ 1

Проблема заключается в apply plugin: 'com.google.gms.google-services'

Плагин Google Services добавляет зависимость от вас. Надеюсь, они исправит это в будущем.

Ответ 2

У меня есть одно и то же предупреждение, вызванное com.google.gms: google-services.

Решение: обновить classpath com.google.gms: google-services to classpath 'com.google.gms: google-services: 3.2.0' в файле в build.gradle Project:

введите описание изображения здесь

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:3.2.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
    }
}

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

В подменю версии 3.1 версии 7.5 для Android Studio заменяется на реализация

с предупреждением в студии Android 3.0

dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
            compile 'com.android.support:appcompat-v7:27.1.0'
            compile 'com.android.support.constraint:constraint-layout:1.0.2'
            testImplementation 'junit:junit:4.12'
            androidTestImplementation 'com.android.support.test:runner:1.0.1'
            androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    }

зависимости OK в студии Android 3.0

    dependencies {
            implementation fileTree(dir: 'libs', include: ['*.jar'])
            implementation 'com.android.support:appcompat-v7:27.1.0'
            implementation 'com.android.support.constraint:constraint-layout:1.0.2'
            testImplementation 'junit:junit:4.12'
            androidTestImplementation 'com.android.support.test:runner:1.0.1'
            androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

    }

Gradel генерирует Android Studio 3.1 для нового проекта.

Gradel generate by Android Studio 3.1 for new project.

Посетите https://docs.gradle.org/current/userguide/dependency_management_for_java_projects.html

Подробнее https://docs.gradle.org/current/userguide/declaring_dependencies.html

Удачи.

Ответ 3

сначала выберите:

  • Создать
  • Очистить проект и построить
  • сделать проект в студии Android

Ответ 4

Когда имя пакета AndroidManifest.xml отличается от имени пакета build.gradle, я получаю эту ошибку

Конфигурация "компиляция" устарела и заменена 'реализация'. Он будет удален в конце 2018 года.

Ошибка компиляции Java

Ответ 5

Измените "компиляцию" на "реализацию". эта проблема будет исправлена! он работает на моем компьютере.

Ответ 6

реализацияConfiguration "компиляция" устарела и заменена "реализацией". Он будет удален в конце 2018 года.