Android 图像选择器。生成失败,出现异常
在连接了图像选择器之后,应用程序开始崩溃,在真正的android设备上出现错误 该库未在任何地方使用,它仅连接。Android 图像选择器。生成失败,出现异常,android,flutter,Android,Flutter,在连接了图像选择器之后,应用程序开始崩溃,在真正的android设备上出现错误 该库未在任何地方使用,它仅连接。 FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':flutter_plugin_android_lifecycle'. > Could not load compiled classes for build file 'C:\
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':flutter_plugin_android_lifecycle'.
> Could not load compiled classes for build file 'C:\devflutt\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-2.0.1\android\build.gradle' from cache.
> Could not get unknown property 'android' for project ':flutter_plugin_android_lifecycle' of type org.gradle.api.Project.
* 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
我从文档中添加了所有必需的内容,但这并没有解决问题
android {
compileSdkVersion 30
...
defaultConfig {
...
minSdkVersion 16
targetSdkVersion 30
...
Android清单:
<application
android:label="touch_dark"
android:icon="@mipmap/ic_launcher"
android:requestLegacyExternalStorage="true">
IOs plist:
...
<key>NSPhotoLibraryUsageDescription</key>
<key>NSCameraUsageDescription</key>
<key>NSMicrophoneUsageDescription</key>
...
。。。
NSPhotoLibraryUsageDescription
NSCameraUsageDescription
NSM话筒用途说明
...
Pubspec.yaml依赖项:
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
image_picker: ^0.7.5
provider: ^5.0.0
环境:
sdk:“>=2.12.0