gpt4 book ai didi

Flutter:Gradle 插件仅支持 Kotlin Gradle 插件版本 1.3.10 及更高版本

转载 作者:行者123 更新时间:2023-12-05 09:10:30 32 4
gpt4 key购买 nike

安卓工作室 3.6 flutter 条码生成器:https://pub.dev/packages/barcode_generator

在 build.gradle 中:

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
maven { url "https://maven.tokend.io" }
}
}

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

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

在 pubspec.yml 中

version: 1.0.0+1

environment:
sdk: ">=2.1.0 <3.0.0"

dependencies:
flutter:
sdk: flutter
logger: ^0.8.3
flutter_statusbarcolor: ^0.2.3
intl: ^0.16.1
carousel_slider: ^2.0.0
adler32: ^1.0.0
barcode_generator: ^0.2.7

但是当我尝试运行项目时出现错误:

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.10 and higher.
The following dependencies do not satisfy the required version:
project ':barcode_generator' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71

* 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 2s
Exception: Gradle task assembleDebug failed with exit code 1

最佳答案

build.gradle 文件中,将 gradle 版本降级到 dependencies 中的 3.2.1,如下所示:

类路径 'com.android.tools.build:gradle:3.2.1'

关于Flutter:Gradle 插件仅支持 Kotlin Gradle 插件版本 1.3.10 及更高版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61389514/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com