gpt4 book ai didi

android - 带有 Onesignal 错误的 Google Play 服务

转载 作者:行者123 更新时间:2023-11-29 19:16:33 26 4
gpt4 key购买 nike

所以我在我的项目中添加了Firebase,然后尝试在我的项目中添加Onesignal。但是我收到这个错误。

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.2.1.

我的应用级 Gradle 文件:-

  apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.kanishq.onesignal"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [onesignal_app_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "xxxxxxxxx"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'com.google.firebase:firebase-core:10.2.1'
compile 'com.onesignal:OneSignal:3.+@aar'

// Required for OneSignal, even if you have added FCM.
compile 'com.google.android.gms:play-services-gcm:+'

// Required for geotagging
compile "com.google.android.gms:play-services-location:+"

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

项目级 Build.gradle :-

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'

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

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

我关注了 Onesignal Documentation- here和 Firebase 文档

救救我!!同时获取 Onesignal 和 Firebase,并消除此错误。谢谢

最佳答案

您发布的依赖项的依赖项报告显示 OneSignal:3.+ 正在解析为 OneSignal:3.4.3,它对版本 10.0.1 具有传递依赖性Firebase 和 Play 服务库。如下所示更新您的依赖项:

compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.onesignal:OneSignal:3.4.3@aar'

// Required for OneSignal, even if you have added FCM.
compile 'com.google.android.gms:play-services-gcm:10.0.1'

// Required for geotagging
compile 'com.google.android.gms:play-services-location:10.0.1'

虽然 OneSignal 文档使用“+”来获取最新版本,但指定依赖项的确切版本被认为更安全,以便更好地了解和控制所使用的版本。

关于android - 带有 Onesignal 错误的 Google Play 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43329049/

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