title: Implementing firebase Crashlytics in Flutter - Could not find method classpath() for arguments
body: <p>Please help... :(</p>
  <p>I get this error when trying to implement Firebase Crashlytics in Flutter:</p>
  <ul>
  <li>Could not find method classpath() for arguments [com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02]</li>
  </ul>
  <p><strong>This is the full error message:</strong></p>
  <pre><code>Launching lib/main_ADHD.dart on HTC 10 in debug mode...
  
  FAILURE: Build failed with an exception.
  
  * Where:
  Build file 'C:\Users\lars\OneDrive - Aalborg Universitet\Programmering\Flutter projekter\meditationsguitarapps\android\app\build.gradle' line: 48
  
  * What went wrong:
  A problem occurred evaluating project ':app'.
  &gt; Could not find method classpath() for arguments [com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02] on DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=null, targetSdkVersion=null, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=null, versionName=null, applicationId=dk.ADHD, testApplicationId=null, testInstrumentationRunner=null, testInstrumentationRunnerArguments={}, testHandleProfiling=null, testFunctionalTest=null, signingConfig=null, resConfig=null, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}, mWearAppUnbundled=null} of type com.android.build.gradle.internal.dsl.DefaultConfig.
  
  * 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 4s
  Running Gradle task 'assembleDebug'...
  Running Gradle task 'assembleDebug'... Done                         8,7s
  Exception: Gradle task assembleDebug failed with exit code 1
  </code></pre>
  <p>This is my <strong>Android/app/build.gradle</strong>:</p>
  <pre><code>def localProperties = new Properties()
  def localPropertiesFile = rootProject.file('local.properties')
  if (localPropertiesFile.exists()) {
      localPropertiesFile.withReader('UTF-8') { reader -&gt;
          localProperties.load(reader)
      }
  }
  
  def flutterRoot = localProperties.getProperty('flutter.sdk')
  if (flutterRoot == null) {
      throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
  }
  
  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 plugin: 'kotlin-android'
  apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;
  
  def keystoreProperties = new Properties()
  def keystorePropertiesFile = rootProject.file('key.properties')
  if (keystorePropertiesFile.exists()) {
      keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  }
  
  android {
      compileSdkVersion 28
  
      sourceSets {
          main.java.srcDirs += 'src/main/kotlin'
      }
  
      lintOptions {
          disable 'InvalidPackage'
      }
  
      defaultConfig {
          // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
          applicationId &quot;dk.ADHD&quot;
          classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0-beta02'
  
          minSdkVersion 16
          targetSdkVersion 28
          versionCode flutterVersionCode.toInteger()
          versionName flutterVersionName
          testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
      }
  
      signingConfigs {
          release {
              keyAlias keystoreProperties['keyAlias']
              keyPassword keystoreProperties['keyPassword']
              storeFile file(keystoreProperties['storeFile'])
              storePassword keystoreProperties['storePassword']
          }
      }
      buildTypes {
          release {
              signingConfig signingConfigs.release
              /* Add the firebaseCrashlytics extension (by default,
              * it's disabled to improve build speeds) and set
              * nativeSymbolUploadEnabled to true. */
              firebaseCrashlytics {
                  nativeSymbolUploadEnabled true
              }
          }
      }
  }
  
  flutter {
      source '../..'
  }
  
  dependencies {
      implementation &quot;org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version&quot;
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'androidx.test:runner:1.2.0'
      androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
      implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
  
  
  }
  
  apply plugin: 'com.google.gms.google-services'
  apply plugin: 'com.google.firebase.crashlytics'
  
  </code></pre>
  <p>This is my <strong>Android/build.gradle</strong>:</p>
  <pre><code>buildscript {
      ext.kotlin_version = '1.2.71'
      repositories {
          google()
          jcenter()
      }
  
      dependencies {
          classpath 'com.android.tools.build:gradle:3.5.3'
          classpath &quot;org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version&quot;
          classpath 'com.google.gms:google-services:4.3.3'   // new
          classpath 'com.google.firebase:firebase-crashlytics-gradle:2.2.0'
  
  
  
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  
  }
  
  rootProject.buildDir = '../build'
  subprojects {
      project.buildDir = &quot;${rootProject.buildDir}/${project.name}&quot;
  }
  subprojects {
      project.evaluationDependsOn(':app')
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  
  </code></pre>
  <p>This is my <strong>pubspec.yaml</strong>:</p>
  <pre><code>name: meditationsguitar
  description: A new Flutter project.
  
  # The following defines the version and build number for your application.
  # A version number is three numbers separated by dots, like 1.2.43
  # followed by an optional build number separated by a +.
  # Both the version and the builder number may be overridden in flutter
  # build by specifying --build-name and --build-number, respectively.
  # In Android, build-name is used as versionName while build-number used as versionCode.
  # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
  # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
  # Read more about iOS versioning at
  # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
  
  version: 1.0.0+34
  
  environment:
    sdk: &quot;&gt;=2.1.0 &lt;3.0.0&quot;
  
  dependencies:
    flutter:
      sdk: flutter
    in_app_purchase: 0.2.2+4
    audioplayers: ^0.12.1
    url_launcher: ^5.4.1
    share: 0.6.3+5
    firebase_core: ^0.4.0+9
    firebase_analytics: ^5.0.10
    shared_preferences: ^0.5.4+6
    firebase_crashlytics: ^0.1.3
  
  
  
  
    # The following adds the Cupertino Icons font to your application.
    # Use with the CupertinoIcons class for iOS style icons.
    cupertino_icons: ^0.1.2
  
  dev_dependencies:
    flutter_test:
      sdk: flutter
    basic_utils: ^1.8.1
    flutter_launcher_icons: &quot;^0.7.3&quot;
    url_launcher: ^5.1.3
    auto_size_text: ^2.1.0
  
  
  
  flutter_icons:
  #  android: &quot;launcher_icon&quot;
    android: true
    ios: true
    #image_path: &quot;assets/images/meditationForBoern/icon/icon.jpg&quot;
    #image_path: &quot;assets/images/mindfulEating/icon/icon.png&quot;
    image_path: &quot;assets/images/ADHD/icon/icon.jpg&quot;
  
  
  
  # For information on the generic Dart part of this file, see the
  # following page: https://dart.dev/tools/pub/pubspec
  
  # The following section is specific to Flutter.
  flutter:
  
    # The following line ensures that the Material Icons font is
    # included with your application, so that you can use the icons in
    # the material Icons class.
    uses-material-design: true
  
    # To add assets to your application, add an assets section, like this:
    assets:
     # - assets/images/meditationForBoern/
     # - assets/audio/meditationForBoern/
     # - assets/images/mindfulEating/
     # - assets/audio/mindfulEating/
      - assets/images/ADHD/
      - assets/audio/ADHD/
  
  
  
    # An image asset can refer to one or more resolution-specific &quot;variants&quot;, see
    # https://flutter.dev/assets-and-images/#resolution-aware.
  
    # For details regarding adding assets from package dependencies, see
    # https://flutter.dev/assets-and-images/#from-packages
  
    # To add custom fonts to your application, add a fonts section here,
    # in this &quot;flutter&quot; section. Each entry in this list should have a
    # &quot;family&quot; key with the font family name, and a &quot;fonts&quot; key with a
    # list giving the asset and other descriptors for the font. For
    # example:
  fonts:
    - family: Roboto
      fonts:
        - asset: fonts/Roboto-Black.ttf
          weight: 900
  
    #       - asset: fonts/TrajanPro_Bold.ttf
    #         weight: 700
    #
    # For details regarding fonts from package dependencies,
    # see https://flutter.dev/custom-fonts/#from-packages
  
  </code></pre>
  <p><strong>How can I fix this?</strong></p>