Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [firebase_core] Could not find method platform() for arguments [com.google.firebase:firebase-bom:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.Def aultDependencyHandler. #3617

Closed
Balaji-V19 opened this issue Sep 22, 2020 · 7 comments
Labels
plugin: core type: bug Something isn't working

Comments

@Balaji-V19
Copy link

Balaji-V19 commented Sep 22, 2020

Bug report

Could not find method platform() for arguments [com.google.firebase:firebase-bom:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.Def
aultDependencyHandler.

I recently added a firebase_messaging plugin to integrate Firebase Notifications. For android, It works fine before and when I made some changes for iOS It's crashing. I won't even be able to build the apk file. I'm not sure what's causing this error but some documentation shows it's because of the Gradle version and I did upgrade to the recent version but still I'm getting this error.

My Gradle file

android/app/gradle:

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "com.mastbazaar.app"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    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 'com.google.firebase:firebase-analytics:17.4.1'
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
    implementation 'com.google.firebase:firebase-core:11.4.2'
    implementation 'com.google.firebase:firebase-messaging:20.2.4'

}

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


Project/gradle:

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

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


Whenever I run >flutter build apk --release

My terminal log will be like:

Running "flutter pub get" in Flutter-Mobile...                      6.4s
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.0\android\build.gradle' line: 38

* What went wrong:
A problem occurred evaluating project ':firebase_core'.
> Could not find method platform() for arguments [com.google.firebase:firebase-bom:25.3.1] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.Def
aultDependencyHandler.

* 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 33s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                      37.7s
Gradle task assembleRelease failed with exit code 1


Additional context

So here is my Flutter doctor, verbose logs


Flutter doctor

Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 1.19.0-4.3.pre, on Microsoft Windows [Version 10.0.18363.1082], locale en-IN)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.49.0)
[√] Connected device (2 available)

• No issues found!


Flutter dependencies

Click To Expand
Dart SDK 2.9.0-14.1.beta
Flutter SDK 1.19.0-4.3.pre
mastbazaar 0.7.0+8

dependencies:
- amazon_cognito_identity_dart 0.0.22 [crypto http]
- cached_network_image 2.2.0+1 [flutter flutter_cache_manager]
- cupertino_icons 0.1.3
- firebase_analytics 5.0.16 [meta flutter firebase_analytics_web firebase_analytics_platform_interface]
- firebase_core 0.5.0 [firebase_core_platform_interface flutter quiver meta firebase_core_web]
- firebase_crashlytics 0.1.4+1 [flutter stack_trace]
- firebase_messaging 7.0.0 [meta platform flutter firebase_core]
- flutter 0.0.0 [collection meta typed_data vector_math sky_engine]
- flutter_calendar_carousel 1.4.12 [intl flutter]
- flutter_launcher_icons 0.7.5 [image args yaml]
- flutter_segment 2.2.2 [flutter flutter_web_plugins meta]
- flutter_statusbarcolor 0.2.3 [flutter]
- flutter_svg 0.17.4 [path_drawing xml vector_math meta flutter]
- graphql_flutter 3.1.0 [graphql flutter meta path path_provider rxdart connectivity gql]
- intl 0.16.1 [path]
- provider 4.3.2+2 [flutter nested collection]
- razorpay_flutter 1.2.2 [flutter eventify]
- shared_preferences 0.5.10 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web]
- url_launcher 5.7.0 [flutter url_launcher_platform_interface url_launcher_web url_launcher_linux url_launcher_macos url_launcher_windows]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector charcode collection matcher meta source_span stream_cha
nnel string_scanner term_glyph typed_data]

transitive dependencies:
- archive 2.0.13 [crypto args path]
- args 1.6.0
- async 2.4.1 [collection]
- boolean_selector 2.0.0 [source_span string_scanner]
- charcode 1.1.3
- clock 1.0.1 [meta]
- collection 1.14.12
- connectivity 0.4.9+2 [flutter meta connectivity_platform_interface connectivity_macos connectivity_for_web]
- connectivity_for_web 0.3.1+2 [connectivity_platform_interface flutter_web_plugins flutter]
- connectivity_macos 0.1.0+5 [flutter]
- connectivity_platform_interface 1.0.6 [flutter meta plugin_platform_interface]
- convert 2.1.1 [charcode typed_data]
- crypto 2.1.5 [collection convert typed_data]
- eventify 0.1.4
- fake_async 1.1.0 [clock collection]
- ffi 0.1.3
- file 5.2.1 [intl meta path]
- firebase 7.3.0 [http http_parser js]
- firebase_analytics_platform_interface 1.0.3 [flutter meta]
- firebase_analytics_web 0.1.1 [flutter flutter_web_plugins firebase firebase_analytics_platform_interface meta]
- firebase_core_platform_interface 2.0.0 [flutter meta plugin_platform_interface quiver]
- firebase_core_web 0.2.0 [firebase firebase_core_platform_interface flutter flutter_web_plugins meta js]
- flutter_cache_manager 1.4.2 [flutter path_provider uuid http path sqflite pedantic clock file rxdart]
- flutter_web_plugins 0.0.0 [flutter collection meta typed_data vector_math]
- gql 0.12.3 [source_span meta collection]
- graphql 3.1.0 [meta http mime path crypto http_parser uuid_enhanced gql rxdart websocket quiver]
- http 0.12.2 [http_parser path pedantic]
- http_parser 3.1.4 [charcode collection source_span string_scanner typed_data]
- image 2.1.13 [archive xml]
- js 0.6.2
- matcher 0.12.6 [stack_trace]
- meta 1.1.8
- mime 0.9.7
- nested 0.0.4 [flutter]
- path 1.7.0
- path_drawing 0.4.1+1 [vector_math meta path_parsing flutter]
- path_parsing 0.1.4 [vector_math meta]
- path_provider 1.6.16 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows]
- path_provider_linux 0.0.1+2 [path xdg_directories path_provider_platform_interface flutter]
- path_provider_macos 0.0.4+4 [flutter]
- path_provider_platform_interface 1.0.3 [flutter meta platform plugin_platform_interface]
- path_provider_windows 0.0.4+1 [path_provider_platform_interface meta path flutter ffi win32]
- pedantic 1.9.0
- petitparser 3.0.4 [meta]
- platform 2.2.1
- platform_detect 1.4.0 [meta pub_semver]
- plugin_platform_interface 1.0.2 [meta]
- process 3.0.13 [file intl meta path platform]
- pub_semver 1.4.4 [collection]
- quiver 2.1.3 [matcher meta]
- rxdart 0.24.1
- shared_preferences_linux 0.0.2+2 [file flutter meta path path_provider_linux shared_preferences_platform_interface]
- shared_preferences_macos 0.0.1+10 [shared_preferences_platform_interface flutter]
- shared_preferences_platform_interface 1.0.4 [meta flutter]
- shared_preferences_web 0.1.2+7 [shared_preferences_platform_interface flutter flutter_web_plugins meta]
- sky_engine 0.0.99
- source_span 1.7.0 [charcode collection meta path term_glyph]
- sqflite 1.3.1+1 [flutter sqflite_common path]
- sqflite_common 1.0.2+1 [synchronized path meta]
- stack_trace 1.9.3 [path]
- stream_channel 2.0.0 [async]
- string_scanner 1.0.5 [charcode meta source_span]
- synchronized 2.2.0+2
- term_glyph 1.1.0
- test_api 0.2.16 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher]
- typed_data 1.1.6
- url_launcher_linux 0.0.1+1 [flutter]
- url_launcher_macos 0.0.1+8 [flutter]
- url_launcher_platform_interface 1.0.8 [flutter meta plugin_platform_interface]
- url_launcher_web 0.1.3+2 [url_launcher_platform_interface platform_detect flutter flutter_web_plugins meta]
- url_launcher_windows 0.0.1+1 [flutter]
- uuid 2.2.2 [crypto convert]
- uuid_enhanced 3.0.2 [crypto convert collection]
- vector_math 2.0.8
- websocket 0.0.5
- win32 1.7.3 [ffi]
- xdg_directories 0.1.0 [path process flutter]
- xml 3.7.0 [collection convert meta petitparser]
- yaml 2.2.1 [charcode collection string_scanner source_span]

Flutter verbose Output

Click To Expand
[  +43 ms] executing: [C:\src\flutter\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +215 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +5 ms] 8fe7655ed20ffd1395f68e30539a847a01a30351
[   +2 ms] executing: [C:\src\flutter\flutter/] git tag --contains HEAD
[ +706 ms] Exit code 0 from: git tag --contains HEAD
[   +1 ms] 1.19.0-4.3.pre
[  +48 ms] executing: [C:\src\flutter\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +138 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +1 ms] origin/beta
[   +1 ms] executing: [C:\src\flutter\flutter/] git ls-remote --get-url origin
[ +121 ms] Exit code 0 from: git ls-remote --get-url origin
[   +1 ms] https://github.com/flutter/flutter.git
[ +295 ms] executing: [C:\src\flutter\flutter/] git rev-parse --abbrev-ref HEAD
[ +131 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +2 ms] beta
[ +210 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +5 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[  +37 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +5 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +88 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +21 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[   +2 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +7 ms] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ +463 ms] Found plugin connectivity at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity-0.4.9+2\
[  +32 ms] Found plugin connectivity_for_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity_for_web-0.3.1+2\
[  +10 ms] Found plugin connectivity_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity_macos-0.1.0+5\
[  +75 ms] Found plugin firebase_analytics at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics-5.0.16\
[  +15 ms] Found plugin firebase_analytics_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics_web-0.1.1\
[  +10 ms] Found plugin firebase_core at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.0\
[  +20 ms] Found plugin firebase_core_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core_web-0.2.0\
[  +14 ms] Found plugin firebase_crashlytics at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_crashlytics-0.1.4+1\
[  +13 ms] Found plugin firebase_messaging at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-7.0.0\
[  +39 ms] Found plugin flutter_segment at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_segment-2.2.2\
[   +8 ms] Found plugin flutter_statusbarcolor at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_statusbarcolor-0.2.3\
[  +92 ms] Found plugin path_provider at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-1.6.16\
[   +7 ms] Found plugin path_provider_linux at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-0.0.1+2\
[   +8 ms] Found plugin path_provider_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-0.0.4+4\
[  +11 ms] Found plugin path_provider_windows at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-0.0.4+1\
[  +42 ms] Found plugin razorpay_flutter at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\razorpay_flutter-1.2.2\
[  +27 ms] Found plugin shared_preferences at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.10\
[  +11 ms] Found plugin shared_preferences_linux at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_linux-0.0.2+2\
[   +8 ms] Found plugin shared_preferences_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+10\
[  +16 ms] Found plugin shared_preferences_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_web-0.1.2+7\
[  +16 ms] Found plugin sqflite at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\sqflite-1.3.1+1\
[  +52 ms] Found plugin url_launcher at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.7.0\
[  +17 ms] Found plugin url_launcher_linux at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-0.0.1+1\
[  +10 ms] Found plugin url_launcher_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-0.0.1+8\
[  +13 ms] Found plugin url_launcher_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-0.1.3+2\
[   +6 ms] Found plugin url_launcher_windows at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-0.0.1+1\
[ +354 ms] Found plugin connectivity at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity-0.4.9+2\
[  +12 ms] Found plugin connectivity_for_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity_for_web-0.3.1+2\
[   +9 ms] Found plugin connectivity_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\connectivity_macos-0.1.0+5\
[  +47 ms] Found plugin firebase_analytics at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics-5.0.16\
[  +14 ms] Found plugin firebase_analytics_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics_web-0.1.1\
[   +9 ms] Found plugin firebase_core at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.0\
[  +14 ms] Found plugin firebase_core_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core_web-0.2.0\
[   +7 ms] Found plugin firebase_crashlytics at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_crashlytics-0.1.4+1\
[   +8 ms] Found plugin firebase_messaging at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_messaging-7.0.0\
[  +24 ms] Found plugin flutter_segment at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_segment-2.2.2\
[   +7 ms] Found plugin flutter_statusbarcolor at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_statusbarcolor-0.2.3\
[  +85 ms] Found plugin path_provider at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-1.6.16\
[  +10 ms] Found plugin path_provider_linux at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-0.0.1+2\
[   +6 ms] Found plugin path_provider_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-0.0.4+4\
[  +14 ms] Found plugin path_provider_windows at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-0.0.4+1\
[  +48 ms] Found plugin razorpay_flutter at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\razorpay_flutter-1.2.2\
[  +16 ms] Found plugin shared_preferences at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.10\
[   +7 ms] Found plugin shared_preferences_linux at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_linux-0.0.2+2\
[  +10 ms] Found plugin shared_preferences_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+10\
[   +8 ms] Found plugin shared_preferences_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences_web-0.1.2+7\
[  +14 ms] Found plugin sqflite at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\sqflite-1.3.1+1\
[  +39 ms] Found plugin url_launcher at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-5.7.0\
[   +5 ms] Found plugin url_launcher_linux at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-0.0.1+1\
[   +5 ms] Found plugin url_launcher_macos at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-0.0.1+8\
[  +11 ms] Found plugin url_launcher_web at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-0.1.3+2\
[   +4 ms] Found plugin url_launcher_windows at C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-0.0.1+1\
[ +317 ms] Generating C:\Users\Hp\Desktop\Flutter_Project\Flutter-Mobile\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +298 ms] You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
[   +4 ms] If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
[   +2 ms]     To generate an app bundle, run:
[   +1 ms]         flutter build appbundle --target-platform android-arm,android-arm64,android-x64
[   +1 ms]         Learn more on: https://developer.android.com/guide/app-bundle
[   +3 ms]     To split the APKs per ABI, run:
[   +2 ms]         flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
[   +9 ms]         Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
[ +102 ms] Running Gradle task 'assembleRelease'...
[  +10 ms] gradle.properties already sets `android.enableR8`
[  +22 ms] Using gradle from C:\Users\Hp\Desktop\Flutter_Project\Flutter-Mobile\android\gradlew.bat.
[   +9 ms] C:\Users\Hp\Desktop\Flutter_Project\Flutter-Mobile\android\gradlew.bat mode: 33279 rwxrwxrwx.
[  +53 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +409 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[   +3 ms] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
           OpenJDK 64-Bit Server VM (build 25.242-b01, mixed mode)
[  +17 ms] executing: [C:\Users\Hp\Desktop\Flutter_Project\Flutter-Mobile\android/] C:\Users\Hp\Desktop\Flutter_Project\Flutter-Mobile\android\gradlew.bat
-Pverbose=true -Ptarget-platform=android-arm,android-arm64,android-x64 -Ptarget=lib\main.dart -Ptrack-widget-creation=true -Pshrink=true -Ptree-shake-icons=true
assembleRelease
[+9420 ms] > Configure project :app
[  +94 ms] WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
[  +56 ms] The current default is 'false'
[  +76 ms] Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
[  +73 ms] Observed package id 'extras;intel;Hardware_Accelerated_Execution_Manager' in inconsistent location
'C:\Users\Hp\AppData\Local\Android\sdk\.temp\PackageOperation02' (Expected
'C:\Users\Hp\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager')
[+2935 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[ +119 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[  +10 ms] registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
[ +886 ms] > Configure project :connectivity
[  +12 ms] WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
[  +13 ms] The current default is 'false'
[   +3 ms] Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
[+1027 ms] > Configure project :firebase_analytics
[  +55 ms] WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
[  +12 ms] The current default is 'false'
[  +47 ms] Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
[  +35 ms] > Configure project :firebase_core
[ +101 ms] WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
[  +17 ms] The current default is 'false'
[   +4 ms] Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
[  +15 ms] FAILURE: Build failed with an exception.
[  +31 ms] * Where:
[   +5 ms] Build file 'C:\src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.0\android\build.gradle' line: 38
[  +14 ms] * What went wrong:
[   +9 ms] A problem occurred evaluating project ':firebase_core'.
[   +3 ms] > Could not find method platform() for arguments [com.google.firebase:firebase-bom:25.3.1] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
[   +6 ms] * Try:
[   +8 ms] 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.
[   +3 ms] * Get more help at https://help.gradle.org
[   +2 ms] BUILD FAILED in 14s
[+2393 ms] Running Gradle task 'assembleRelease'... (completed in 17.9s)
[ +114 ms] "flutter apk" took 21,022ms.
Gradle task assembleRelease failed with exit code 1

#0      throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1      buildGradleApp (package:flutter_tools/src/android/gradle.dart:411:7)
#2      _rootRunUnary (dart:async/zone.dart:1198:47)
#3      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#4      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#5      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#6      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#7      Future._completeWithValue (dart:async/future_impl.dart:529:5)
#8      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#9      _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#10     _DefaultProcessUtils.stream (package:flutter_tools/src/base/process.dart)
#11     _rootRunUnary (dart:async/zone.dart:1198:47)
#12     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#13     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#14     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#15     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#16     Future._completeWithValue (dart:async/future_impl.dart:529:5)
#17     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#18     _rootRun (dart:async/zone.dart:1190:13)
#19     _CustomZone.run (dart:async/zone.dart:1093:19)
#20     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#21     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#22     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#23     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#24     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#25     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

---
@Balaji-V19 Balaji-V19 added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Sep 22, 2020
@TahaTesser
Copy link

Hi @bjoffficial
Please use classpath 'com.android.tools.build:gradle:3.5.0' & classpath 'com.google.gms:google-services:4.3.3' and try again

If the problem persists, Can you please provide your flutter doctor -v logs, and a minimal complete reproducible code sample
Thank you

@TahaTesser TahaTesser added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Sep 22, 2020
@machinescream
Copy link

Hi @bjoffficial
Please use classpath 'com.android.tools.build:gradle:3.5.0' & classpath 'com.google.gms:google-services:4.3.3' and try again

If the problem persists, Can you please provide your flutter doctor -v logs, and a minimal complete reproducible code sample
Thank you

Hi, same issue with dependencies suggested by you. flutter channel beta

@jaween
Copy link

jaween commented Sep 26, 2020

I had the same problem as @bjoffficial, following @TahaTesser's suggestion, for me the solution was:
Upgrade the Android Gradle plugin to 3.5.0
Upgrade the Google Services plugin to 4.3.3
Upgrade Gradle to 5.4.1 (the required Gradle version for this Android Gradle plugin version)

flutter doctor -v output (click to expand)
[✓] Flutter (Channel beta, 1.22.0-12.1.pre, on Linux, locale en_AU.UTF-8)
    • Flutter version 1.22.0-12.1.pre at /opt/flutter
    • Framework revision 8b3760638a (11 days ago), 2020-09-15 17:47:13 -0700
    • Engine revision 4654fc6cf6
    • Dart version 2.10.0 (build 2.10.0-110.3.beta)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/jaween/Android/Sdk
    • Platform android-30, build-tools 29.0.3
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/google-chrome-stable

[✓] Android Studio (version 4.0)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 48.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (3 available)
    • SM A520F (mobile) • 5200676a4a815579 • android-arm64  • Android 8.0.0 (API 26)
    • Web Server (web)  • web-server       • web-javascript • Flutter Tools
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 85.0.4183.83

• No issues found!

@TahaTesser TahaTesser added plugin: core and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Sep 29, 2020
@j0nscalet
Copy link

I'm using firebase_crashlytics 0.2.0/ firebase_core 0.5.0.

Upgrading gradle to 5.4.1 and using classpath 'com.android.tools.build:gradle:3.5.0' resolved this.

As @Renesanse and @jaween mention. Note: I am not using Google Services plugin so I didn't need to upgrade it.

@RathaIct
Copy link

Add cloud_firestore in pubspec.yaml
It work for me.

@andesappal
Copy link

Same issue

atn832 added a commit to atn832/fake_cloud_firestore that referenced this issue Apr 18, 2021
Fix:

```
A problem occurred evaluating project ':cloud_firestore'.
> Could not find method platform() for arguments [com.google.firebase:firebase-bom:26.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
```

according to firebase/flutterfire#3617 (comment)
@russellwheatley
Copy link
Member

As far as I can tell, this isn't an issue with the core package, and looks like a configuration problem with the application.

@firebase firebase locked and limited conversation to collaborators Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
plugin: core type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants