Flutter.Gradle插件只支持Kotlin Gradle插件1.3.10以上版本。Gradle插件仅支持Kotlin Gradle插件1.3.10及以上版本。

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

Android Studio 3.6FlutterBarCodeGenerator。https:/pub.devpackagesbarcode_generator。

在build.gradle.pubspec.yml中。

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
flutter android-studio-3.0
1个回答
1
投票

build.gradle 降级 渐变 中的3.2.1版本。依赖性 像这样。

classpath 'com.android.tools.build:gradle:3.2.1' 。

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