App/build.gradle 在我进行更改后显示错误

问题描述 投票:0回答:1

我正在尝试更改我的 applicationId 和命名空间的名称,以便我可以将我的应用程序放在 Google Play 上。

我已经在 Firebase 中对必要的文件做了很多工作,但我刚刚注意到 app/build.gradle 文件中存在一个错误:

The supplied phased action failed with an exception.
A problem occurred configuring root project 'android'.
A problem occurred evaluating root project 'android'.
A problem occurred configuring project ':app'.
Build file 'C:\deal_diligence\deal_diligence\android\app\build.gradle' line: 4
An exception occurred applying plugin request [id: 'dev.flutter.flutter-gradle-plugin', version: '1.0.0']
Could not find implementation class 'FlutterPlugin' for plugin 'dev.flutter.flutter-gradle-plugin' specified in jar:file:/C:/Users/Owner/.gradle/caches/jars-9/12cba31fab3a51632261745af12b9ffc/gradle-1.0.0.jar!/META-INF/gradle-plugins/dev.flutter.flutter-gradle-plugin.properties.
FlutterPluginJava(0)

这是build.gradle文件:

plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin" <<< ERROR IN FRONT OF THIS LINE
    id "com.google.gms.google-services"
} 

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

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

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

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    namespace "com.kane.dealdiligence"
    //compileSdkVersion flutter.compileSdkVersion
    compileSdkVersion 34
    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.kane.dealdiligence"
        // 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
        minSdkVersion 21
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

       signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
       }
   }

}

flutter {
    source '../..'
}

dependencies {
    //implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
    implementation 'androidx.multidex:multidex:2.0.1'
}

错误已标记在插件部分的左边距中。

这里出了什么问题? 谢谢

flutter build.gradle
1个回答
0
投票

您可以删除此行:

id "dev.flutter.flutter-gradle-plugin"

现已弃用

© www.soinside.com 2019 - 2024. All rights reserved.