ОШИБКА: не удалось разрешить: com.google.firebase: firebase-core: 17.3.99 - PullRequest
0 голосов
/ 30 октября 2019

Я купил этот код приложения в codecanyon, но автор не отвечает. Вот почему я спрашиваю здесь. Я не знаю об Android, я просто следую их учебнику. Вот моя проблема. Может ли кто-нибудь помочь, пожалуйста?

версия Gradle
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Это ошибка, которую я получаю

ОШИБКА: Не удалось устранить: com. google.firebase: firebase-core: 17.3.99
Показать в диалоговом окне "Структура проекта"
Затронутые модули: приложение

ОШИБКА: не удалось разрешить: com.google.android.gms: play-services-ads: 17.3.99
Показать в диалоговом окне "Структура проекта"
Затронутые модули: приложение

ОШИБКА: Не удалось разрешить: com.google.firebase: передача сообщений firebase: 17.3.99
Показать вДиалог структуры проекта
Затронутые модули: приложение

ОШИБКА: не удалось разрешить: com.google.android.gms: play-services-location: 17.3.99
Показать в диалоговом окне структуры проекта
Затронутые модули: приложение

ОШИБКА: не удалось разрешить: com.google.android.gms: идентификатор play-services-ads-идентификатора: 17.3.99
Показать в диалоговом окне "Структура проекта"
Затронутые модули: приложение

ОШИБКА: не удалось разрешить: com.google.android.gms: база play-services: 17.3.99
Показать вДиалог структуры проекта
Затронутые модули: приложение

1 Ответ

0 голосов
/ 30 октября 2019

здесь https://firebase.google.com/support/release-notes/android, есть последняя версия Firebase. О firebase-core, последняя версия 17.2.1. как я видел на вашем уровне приложения build.gradle, вы используете «compile» для ваших зависимостей, вы должны изменить всю эту компиляцию реализацией и обновить версию ваших зависимостей до последней версии, такой как

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-v4:26.1.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:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.squareup.retrofit2:retrofit:2.6.2'
    implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
    implementation 'com.squareup.okhttp3:logging-interceptor:4.2.1'
    implementation 'com.squareup.okhttp3:okhttp:4.2.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.squareup.okhttp:okhttp:2.2.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.facebook.stetho:stetho:1.1.1'
    implementation 'com.facebook.stetho:stetho-okhttp:1.1.1'
    implementation 'com.github.bumptech.glide:glide:3.7.0'

    implementation 'com.google.firebase:firebase-core:17.2.1'
    implementation 'com.onesignal:OneSignal:3.12.2'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'org.jsoup:jsoup:1.10.1'
    implementation 'com.google.android.gms:play-services-ads:18.2.0'
    implementation 'com.google.firebase:firebase-messaging:20.0.0'

}

youследует также использовать последнюю версию google-сервисов;Обновите свой уровень проекта build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:4.3.2'

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

Обновите версию Gradle в файле gradle.properties:

#Mon May 21 12:39:33 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

Вы можете найти все настройки firebase здесь https://firebase.google.com/docs/android/setup

...