Flutter 构建应用程序时颤振文件\u选取器包错误
我已经创建了一个颤振应用程序,部分要求是从存储中选择文件。由于有几个教程在使用它,我决定使用Flutter 构建应用程序时颤振文件\u选取器包错误,flutter,dart,flutter-file,Flutter,Dart,Flutter File,我已经创建了一个颤振应用程序,部分要求是从存储中选择文件。由于有几个教程在使用它,我决定使用文件\u picker 3.0.1包。但是,我在尝试运行我的应用程序时遇到问题。我甚至还没有开始使用这个软件包。这是我得到的错误 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > A failure occurre
文件\u picker 3.0.1
包。但是,我在尝试运行我的应用程序时遇到问题。我甚至还没有开始使用这个软件包。这是我得到的错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\Hp\FlutterProjects\flutter_application_test\build\file_picker\intermediates\library_manifest\debug\AndroidManifest.xml:9:5-15:15: AAPT: error: unexpected element <queries> found in <manifest>.
* 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 5m 31s
这是pubspec.yaml
文件
name: flutter_application_test
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 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.7.0 <3.0.0"
dependencies:
shared_preferences: ^2.0.5
http: ^0.13.1
json_annotation: ^4.0.1
flutter_launcher_icons: ^0.9.0
flutter_slidable: ^0.6.0-nullsafety.0
animations: ^2.0.0
image_picker: ^0.7.4
firebase_core: ^1.1.0
firebase_storage: ^8.0.5
permission_handler: ^7.0.0
firebase_analytics: ^8.0.2
file_picker: ^3.0.1
flutter_rounded_date_picker: ^2.0.1
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
build_runner: ^1.11.5
json_serializable: ^4.1.0
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "images/pcl2.png"
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/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:
- images/
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/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: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - 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.dev/custom-fonts/#from-packages
名称:颤振应用试验
描述:一个新的颤振项目。
#以下行可防止将包意外发布到
#pub.dev使用“pub publish”。这是私人软件包的首选。
发布到:“无”#如果要发布到pub.dev,请删除此行
#下面定义了应用程序的版本和内部版本号。
#版本号是由点分隔的三个数字,如1.2.43
#后跟可选的内部版本号,以+分隔。
#版本和制造商编号都可能在颤振中被覆盖
#通过分别指定--build name和--build number来生成。
#在Android中,版本名用作版本名,而版本号用作版本代码。
#更多关于Android版本控制的信息,请访问https://developer.android.com/studio/publish/versioning
#在iOS中,生成名称用作CbundleShortVersionString,而生成编号用作CbundLeverVersion。
#阅读有关iOS版本控制的更多信息,请访问
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
版本:1.0.0+1
环境:
sdk:“>=2.7.0请共享您的pubspec.yaml
文件的屏幕截图,如果您将pubspec.yaml
粘贴到问题中,效果会更好。代码截图很难搜索和阅读。请在系统中设置ANDROID_HOME变量。@JorgeVieira如何设置?@JorgeVieira是的。我认为这是一个渐变问题。我将gradle wrapper.properties中的gradle版本更改为5.6.4-all.zip,构建成功
name: flutter_application_test
description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 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.7.0 <3.0.0"
dependencies:
shared_preferences: ^2.0.5
http: ^0.13.1
json_annotation: ^4.0.1
flutter_launcher_icons: ^0.9.0
flutter_slidable: ^0.6.0-nullsafety.0
animations: ^2.0.0
image_picker: ^0.7.4
firebase_core: ^1.1.0
firebase_storage: ^8.0.5
permission_handler: ^7.0.0
firebase_analytics: ^8.0.2
file_picker: ^3.0.1
flutter_rounded_date_picker: ^2.0.1
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
build_runner: ^1.11.5
json_serializable: ^4.1.0
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "images/pcl2.png"
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/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:
- images/
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/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: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - 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.dev/custom-fonts/#from-packages