У меня была такая же ошибка при добавлении Firebase в мое приложение Ionic.Оказывается, я помещал линию implementation 'com.google.firebase:firebase-core:16.0.1'
в dependencies
, найденную в buildscript
, когда эту строку нужно было поместить в dependencies
на уровне приложения (см. Ниже).
Поместите implementation 'com.google.firebase:firebase-core:16.0.1'
здесь:
dependencies {
implementation fileTree(dir: 'libs', include: '*.jar')
implementation 'com.google.firebase:firebase-core:16.0.1'
// SUB-PROJECT DEPENDENCIES START
implementation(project(path: ":CordovaLib"))
compile "com.android.support:support-annotations:27.+"
compile "com.android.support:support-v4:24.1.1+"
compile "com.google.firebase:firebase-core:16.0.+"
compile "com.google.android.gms:play-services-analytics:11.0.1"
// SUB-PROJECT DEPENDENCIES END
}
не здесь:
buildscript {
repositories {
mavenCentral()
maven {
url "https://maven.google.com"
}
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
Если это поможет, я обнаружил зависимости на уровне приложенияраздел внизу моего файла уровня проекта build.gradle
.
Удачи!