更新目标版本后P
出现错误
错误:无法解析“:app@debug/compileClasspath”的依赖关系:无法解析com.google.firebase:firebase-analytics:11.8.0。打开文件
显示详细信息
1.我添加了 google()
项目中的gradle文件
2.我还通过同步和清理项目进行了检查。
我检查了下面的链接
1.App/Gradle
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId 'com.ctdiindia.b2b'
minSdkVersion 15
targetSdkVersion 'P'
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
buildToolsVersion '27.0.3'
productFlavors {
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//Testing
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'
testCompile 'org.mockito:mockito-all:1.10.19'
// Firebase
compile 'com.google.firebase:firebase-analytics:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
// Firebase UI
compile 'com.firebaseui:firebase-ui-database:3.1.0'
//Reycycler View
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
//Networking
implementation 'com.google.code.gson:gson:2.8.2'
compile 'com.amitshekhar.android:android-networking:1.0.1'
//Observabale librares
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.8'
}
apply plugin: 'com.google.gms.google-services'
2.项目/Gradle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
有人有这个类似的问题吗?