【问题标题】:Could not proceed while implementing map_view实施 map_view 时无法继续
【发布时间】:2019-06-07 14:02:19
【问题描述】:

我正在尝试在我的颤振应用程序中实现 map_view,但是当我提供依赖项然后运行该应用程序时,它会显示一些错误。而且,我不知道如何解决它。

我的错误:- * 运行 Gradle 时出错: ProcessException:进程“D:\development\flutter\flutter_course\android\gradlew.bat”异常退出:

配置项目:map_view 警告:指定的 Android SDK 构建工具版本 (27.0.3) 将被忽略,因为它低于 Android Gradle 插件 3.2.1 的最低支持版本 (28.0.3)。 将使用 Android SDK 构建工具 28.0.3。 要禁止显示此警告,请从 build.gradle 文件中删除“buildToolsVersion '27.0.3'”,因为每个版本的 Android Gradle 插件现在都有一个默认版本的构建工具。 ****************************************************** ******* 警告:如果此版本的 shared_preferences 或其依赖项与 AndroidX 不兼容,它将破坏您的 Android 构建。 此警告会针对所有 Android 构建失败打印。错误的真正根本原因可能是无关的。 ****************************************************** *******

FAILURE:构建失败并出现异常。

  • 出了什么问题: Android Gradle 插件仅支持 Kotlin Gradle 插件版本 1.2.51 及更高版本。项目“android”使用的是 1.1.2-4 版本。

我的 build.gradle:-

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-4'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

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

我的 pubspec.yaml 文件:-

name: flutter_course
description: A new Flutter project.

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  scoped_model: ^1.0.1
  http: ^0.12.0+2
  shared_preferences: ^0.5.3+1
  rxdart: ^0.22.0
  map_view: ^0.0.14

dev_dependencies:
  flutter_test:
    sdk: flutter


# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
   - assets/race.jpg
   - assets/bg.jpg
  #  - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.io/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.io/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  fonts:
    - family: Oswald
      fonts:
        - asset: assets/Oswald-Bold.ttf
          weight: 700
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.io/custom-fonts/#from-packages
analyzer:
  strong-mode: true
  language:
    enableSuperMixins: true

【问题讨论】:

    标签: flutter dart sdk android-mapview


    【解决方案1】:

    将您的 kotlin 版本更改为 1.2.51

      classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51 
    

    并检查应用程序内的targetSdkVersion-->buildGradle,如果低于28,则将其更改为28

    如果有问题请告诉我

    【讨论】:

    • 我已经试过了,没有变化,还是一样的错误。
    猜你喜欢
    • 1970-01-01
    • 2013-02-09
    • 1970-01-01
    • 2016-12-25
    • 1970-01-01
    • 2022-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多