AndroidStudio3.6颤振BarCodeGenerator: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发布于 2020-04-23 14:47:32
在build.gradle文件中,将gradle版本降级为3.2.1,在依赖项中如下所示:
类路径'com.android.tools.build:gradle:3.2.1‘
发布于 2022-01-28 20:41:34
将ext.kotlin_version = '1.3.50'中的build.gradle更新为ext.kotlin_version = '1.6.10'并再次运行该程序。这对我有用。
https://stackoverflow.com/questions/61389514
复制相似问题