我正在尝试在我的flutter应用程序中实现map_view,但是当我提供依赖项然后运行该应用程序时,它显示了一些错误。而且,我不知道该如何解决。
我的错误:- *运行Gradle时出错: ProcessException:进程“ D:\ development \ flutter \ flutter_course \ android \ gradlew.bat”异常退出:
配置项目:map_view 警告:指定的Android SDK Build Tools版本(27.0.3)被忽略,因为它低于Android Gradle Plugin 3.2.1的最低支持版本(28.0.3)。 将使用Android SDK Build Tools 28.0.3。 要取消显示此警告,请从build.gradle文件中删除“ buildToolsVersion '27 .0.3'”,因为每个版本的Android Gradle插件现在都具有默认版本的构建工具。 ****************************************************** ******* 警告:如果此版本的shared_preferences或其依赖项与AndroidX不兼容,则会破坏您的Android构建。 此警告会针对所有Android构建失败进行打印。错误的真正根本原因可能无关。 ****************************************************** *******
失败:构建失败,并出现异常。
我的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
答案 0 :(得分:0)
将您的kotlin版本更改为1.2.51
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51
然后在app-> buildGradle中检查targetSdkVersion,如果低于28,则将其更改为28
让我知道是否有问题