前提・実現したいこと
AndroidアプリをFirebaseに接続しようとしていて、
AnalyticsとMKkitを入れようとしています。
Firebase Consoleの手順に従ってGradleファイルのimplementation等を追加していました。
https://firebase.google.com/docs/cloud-messaging/android/client?hl=ja
発生している問題・エラーメッセージ
アプリを一度実行しようとしたところ、
Build outputに
In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.0. 2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown. Dependency failing: com.google.android.gms:play-services-vision:20.0.0 -> com.google.android.gms:play-services-vision-co mmon@[19.0.2], but play-services-vision-common version was 19.1.0. The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art ifact with the issue. -- Project 'app' depends onto com.google.firebase:firebase-ml-vision@{strictly 24.1.0} -- Project 'app' depends onto com.google.firebase:firebase-bom@24.1.0 -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.0} -- Project 'app' depends onto com.google.firebase:firebase-bom@{strictly 24.1.0} -- Project 'app' depends onto com.google.firebase:firebase-ml-vision@24.1.0 -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@{strictly 18.0.4} -- Project 'app' depends onto com.google.android.gms:play-services-vision@{strictly 20.0.0} For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https:// github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = true }" to your bu ild.gradle file.
Gradleファイルのコード
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 29 buildToolsVersion "30.0.0" defaultConfig { applicationId "com.example.ikuya.missionalertclock" minSdkVersion 21 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.core:core-ktx:1.3.1' implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.1' implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0' implementation 'androidx.navigation:navigation-ui-ktx:2.3.0' implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' // Import the Firebase BoM implementation platform('com.google.firebase:firebase-bom:24.1.0') // Add the dependency for the Firebase SDK for Google Analytics // When using the BoM, don't specify versions in Firebase dependencies implementation 'com.google.firebase:firebase-core:17.0.0' implementation 'com.google.firebase:firebase-messaging-ktx' implementation 'com.google.firebase:firebase-analytics-ktx' implementation 'com.google.firebase:firebase-ml-vision:24.1.0' }
試したこと
Implementationの以下をコメントアウトしたらエラーなく実行されました。
// implementation 'com.google.firebase:firebase-messaging-ktx' // implementation 'com.google.firebase:firebase-analytics-ktx' // implementation 'com.google.firebase:firebase-ml-vision:24.1.0'
補足情報(FW/ツールのバージョンなど)
ProjectのGradleファイル
/ Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.kotlin_version = "1.4.0" repositories { google() jcenter() } dependencies { classpath "com.android.tools.build:gradle:4.0.1" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.4' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() } } task clean(type: Delete) { delete rootProject.buildDir }
あなたの回答
tips
プレビュー