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