前提・実現したいこと
firebaseにflutterアプリ(Android)を追加させたいですが実行させるとエラーになってしまいます。
原因わかる方おりましたら教えていただけますでしょうか
発生している問題・エラーメッセージ
FAILURE: Build failed with an exception.
- What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.android.gms:play-services-base:15.0.1 -> com.google.android.gms:play-services-basement@[1
5.0.1], but play-services-basement version was 17.0.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 on project 'firebase_auth' which depends onto com.google.firebase:firebase-auth@16.0.2
-- Project 'app' depends onto com.google.android.gms:play-services-ads-identifier@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-auth-interop@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-auth@{strictly 16.0.2}
-- Project 'app' depends onto com.google.android.gms:play-services-base@{strictly 15.0.1}
-- Project 'app' depends onto com.google.firebase:firebase-installations@{strictly 16.3.2}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 17.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk@{strictly 17.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement@{strictly 17.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-tasks@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-common@{strictly 19.3.0}
-- Project 'app' depends onto com.google.android.gms:play-services-basement@{strictly 17.0.0}
-- Project 'app' depends onto com.google.android.gms:play-services-stats@{strictly 17.0.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk-api@{strictly 17.5.0}
-- Project 'app' depends onto com.google.firebase:firebase-installations-interop@{strictly 16.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-analytics@17.5.0
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-base@{strictly 17.5.0}
-- Project 'app' depends onto com.google.firebase:firebase-measurement-connector@{strictly 18.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 17.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-impl@{strictly 17.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-flags@{strictly 15.0.1}
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 = false }" to your b
uild.gradle file.
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
- Get more help at https://help.gradle.org
BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
エラーメッセージ
app/build.gradle
app/build.gradle
1def localProperties = new Properties() 2def localPropertiesFile = rootProject.file('local.properties') 3if (localPropertiesFile.exists()) { 4 localPropertiesFile.withReader('UTF-8') { reader -> 5 localProperties.load(reader) 6 } 7} 8 9def flutterRoot = localProperties.getProperty('flutter.sdk') 10if (flutterRoot == null) { 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12} 13 14def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15if (flutterVersionCode == null) { 16 flutterVersionCode = '1' 17} 18 19def flutterVersionName = localProperties.getProperty('flutter.versionName') 20if (flutterVersionName == null) { 21 flutterVersionName = '1.0' 22} 23 24apply plugin: 'com.android.application' 25apply plugin: 'com.google.gms.google-services' 26apply plugin: 'kotlin-android' 27apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 28 29android { 30 compileSdkVersion 28 31 32 sourceSets { 33 main.java.srcDirs += 'src/main/kotlin' 34 } 35 36 lintOptions { 37 disable 'InvalidPackage' 38 } 39 40 defaultConfig { 41 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 42 applicationId "com.example.flutter_app_test" 43 minSdkVersion 21 44 multiDexEnabled true 45 targetSdkVersion 28 46 versionCode flutterVersionCode.toInteger() 47 versionName flutterVersionName 48 } 49 50 buildTypes { 51 release { 52 // TODO: Add your own signing config for the release build. 53 // Signing with the debug keys for now, so `flutter run --release` works. 54 signingConfig signingConfigs.debug 55 } 56 } 57} 58 59flutter { 60 source '../..' 61} 62 63dependencies { 64 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 65 implementation 'com.google.firebase:firebase-analytics:17.5.0' 66}
android/build.gradleコード
android/build.gradle
1buildscript { 2 ext.kotlin_version = '1.3.50' 3 repositories { 4 google() 5 jcenter() 6 } 7 8 dependencies { 9 classpath 'com.android.tools.build:gradle:3.5.0' 10 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 classpath 'com.google.gms:google-services:4.3.3' 12 } 13} 14 15allprojects { 16 repositories { 17 google() 18 jcenter() 19 } 20} 21 22rootProject.buildDir = '../build' 23subprojects { 24 project.buildDir = "${rootProject.buildDir}/${project.name}" 25} 26subprojects { 27 project.evaluationDependsOn(':app') 28} 29 30task clean(type: Delete) { 31 delete rootProject.buildDir 32} 33
補足情報(FW/ツールのバージョンなど)
Flutter 1.21.0-7.0.pre • channel master • https://github.com/flutter/flutter.git
Framework • revision ddb8e6e3bf (8 weeks ago) • 2020-07-22 20:00:07 -0700
Engine • revision dcc9a4048d
Tools • Dart 2.9.0 (build 2.9.0-21.0.dev 9dca49e71e)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。