English 中文(简体)
1. 建立档案 C:deal_diligenceandroiduild.gradle Line: 11
原标题:Build file C:deal_diligenceandroiduild.gradle line: 11

I m在建筑中发现一处建筑错误。 第11行的梯度档案。

我从档案中删除了“新的”关键词,但我仍然有错误。

这里是我建造的。 格勒布档案:

def localProperties = 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 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 plugin:  com.google.gms.google-services 
apply plugin:  kotlin-android 
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    namespace "com.natekane.deal_diligence"
    compileSdkVersion flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget =  1.8 
    }

    sourceSets {
        main.java.srcDirs +=  src/main/kotlin 
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.natekane.deal_diligence"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source  ../.. 
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation platform("com.google.firebase:firebase-bom:32.3.1")
}

这里是“ de窗”的错误信息:

Build file  C:deal_diligenceandroiduild.gradle  line: 11

* What went wrong:
A problem occurred evaluating root project  android .
> Could not find method id() for arguments [com.google.gms.google-services] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Everything I have found so far says for me to delete the "new" keyword.

I am trying to add Firebase to the app so maybe I messed up the other build.gradle file too?

What else can I do? Thanks

问题回答

错误已经指出,建筑档案中的错误 C:deal_diligenceandroiduild。 梯度线:11”

哪些是指甲状腺/bu。 梯度档案,但与我们分享。 格勒布档案。

ry/bu。 依属地({......})内部的梯度文档和下线,如果没有:

classpath  com.google.gms:google-services:4.3.15 




相关问题
Flutter App cannot be installed on Android TV

I m building a Flutter app that should support Android TV and Mobile devices. Despite Google Play shows that it is supported, I cannot install app on my MiBox device. While trying to install it, both ...

Moving the icon button to the right causes rendering issues

I am trying to align the icon button to the right of the Text field, I tried the row which made the icon button not centered vertically and now I am trying out the Stack widget. Here is my code - ...

热门标签