0

Когда я изменяю значение compileSdkVersion 26 и targetSdkVersion 26 на 29 возникает ошибка в строке

(implementation 'com.android.support:appcompat-v7:26.+')

Version 28 (intended for Android Pie and below) is the last version of the legacy support library, so we recommend that you migrate to AndroidX libraries when using Android Q and moving forward. The IDE can help with this: Refactor > Migrate to AndroidX... less... (Ctrl+F1) Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion). Issue id: GradleCompatible

если строку убрать то становиться ещё хуже !

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 26
        buildToolsVersion '28.0.3'
        defaultConfig {
            applicationId "name"
            minSdkVersion 16
            targetSdkVersion 26
            versionCode 63
            versionName "4.4"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                minifyEnabled  true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        productFlavors {
        }
    }

    dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
        implementation 'com.android.support:appcompat-v7:26.+'
        implementation 'com.android.support.constraint:constraint-layout:1.0.2'
        implementation 'com.google.firebase:firebase-ads:10.0.1'
        implementation 'junit:junit:4.12'
    }




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

1 ответ 1

1

Вам необходимо перевести свой проект на AndroidX.
В Android Studio нажмите на Refactor -> Migrate to AndroidX.
После этого можно переводить проект на 29 версию.
Про AndroidX.
Список библиотек переехавших на AndroidX.

1
  • Вы всё правильно сказали - но сначала нужно изменить цифры на 29 . А потом сделать (В Android Studio нажмите на Refactor -> Migrate to AndroidX.) Иначе выпадает ошибка ( типа , что синхронизировать можно только с 28 версии)
    – Yacow
    26 июл 2019 в 17:05

Ваш ответ

Нажимая на кнопку «Отправить ответ», вы соглашаетесь с нашими условиями использования и подтверждаете, что прочитали и поняли наши политику конфиденциальности и нормы поведения.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.