简体   繁体   English

在 Android Studio 中构建失败的 Flutter 项目

[英]Build failed Flutter project in Android studio

I upgraded the Android Studio to Arctic Fox 2020.3.1 Patch 3 , but the flutter project was failed when I build the project.我把Android Studio升级到Arctic Fox 2020.3.1 Patch 3 ,但是我建项目的时候flutter项目失败了。 It worked well before.它以前运行良好。

Here is the error log:这是错误日志:

Launching lib/main.dart on SM G935S in debug mode...
Running Gradle task 'assembleDebug'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @44d075e4

* 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 16s
Exception: Gradle task assembleDebug failed with exit code 1

问题截图

Here is my env:这是我的环境:

[✓] Flutter (Channel stable, 1.22.6, on macOS 11.6 20G165 darwin-arm, locale en-US)
    • Flutter version 1.22.6 at /Volumes/WORK/SDK/flutter
    • Framework revision 9b2d32b605 (9 months ago), 2021-01-22 14:36:39 -0800
    • Engine revision 2f0af37152
    • Dart version 2.10.5

 
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Volumes/WORK/SDK/Android/
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Volumes/WORK/SDK/Android/
    • ANDROID_SDK_ROOT = /Volumes/WORK/SDK/Android/
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk-16.0.2.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 16.0.2+7-67)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.0, Build version 13A233
    • CocoaPods version 1.10.1

[!] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] VS Code (version 1.61.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

Android Studio 版- Android Studio 北极狐| 2020.3.1 补丁 3

Would you please let me know how can I fix this issue?你能告诉我如何解决这个问题吗?

Reinstall dart and Flutter plugins and restart the ide, it will be okay then.重新安装dart和Flutter插件,重启ide,就可以了。 Sometimes does not get configured properly.有时未正确配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM