gpt4 book ai didi

java - 添加 firebase 与 google play 服务冲突

转载 作者:行者123 更新时间:2023-11-29 23:27:31 28 4
gpt4 key购买 nike

自从将 Firebase 添加到我的应用程序以便我可以通过应用中心向用户发送推送通知后,我遇到了很多问题。

我目前遇到两个库之间可能存在的合并问题。

Failed to notify dependency resolution listener.
The library com.google.android.gms:play-services-basement is being
requested by various other libraries at [[15.0.1,15.0.1]], but
resolves to 16.0.1. Disable the plugin and check your dependencies
tree using ./gradlew :app:dependencies.

正如您在这里看到的,我对 play-services-basement 没有任何特定的依赖...

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'io.realm:realm-gradle-plugin:5.3.1'
}
}


apply plugin: 'com.android.application'

apply plugin: 'io.fabric'

apply plugin: 'realm-android'

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

realm {
syncEnabled = true
}

repositories {
maven { url 'https://maven.fabric.io/public' }
}

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.xxxxsoftware.xxxx.xxxx"
minSdkVersion 16
targetSdkVersion 28
versionCode 36
versionName "2.8.17"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

lintOptions {

checkReleaseBuilds false

}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true
}
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 fileTree(include: ['*.jar'], dir: 'libs')
def appCenterSdkVersion = '1.9.0'

implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}"
implementation "com.microsoft.appcenter:appcenter-push:${appCenterSdkVersion}"

implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.zxing:core:3.3.3'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'

implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
implementation 'com.github.delight-im:Android-SimpleLocation:v1.0.1'
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'io.realm:android-adapters:3.0.0'
implementation 'androidmads.library.qrgenearator:QRGenearator:1.0.3'
implementation 'com.journeyapps:zxing-android-embedded:3.1.0@aar'
implementation 'com.github.pwittchen:reactivenetwork-rx2:2.0.0'
}

我已经运行了命令 ./gradlew :app:dependencies 并打印出:

* What went wrong:
Project 'app' not found in root project 'ChimePassportAndroid'.

最佳答案

为了使用 Firebase 消息传递,您需要在 build.gradle 文件中添加相应的依赖项,如下所示:

implementation 'com.google.firebase:firebase-messaging:17.3.4'

你的问题就迎刃而解了。

关于java - 添加 firebase 与 google play 服务冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53301399/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com