我将flutter代码从Windows复制到MacOS,我正在尝试运行它,但它遇到了以下错误:
Execution failed for task ':app:compileFlutterBuildDebug'.
> java.net.URISyntaxException: Illegal character in opaque part at index 2: D:\Gocut Cares Application\gocutcare\android\app\build\intermediates\flutter\debug\flutter_assets\AssetManifest.json
BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1
我已经运行了flutter清理,flutter升级,重新启动了一切。什么都不管用。请帮助
颤振刮刀输出:
[✓] Flutter (Channel stable, 2.5.0, on Mac OS X 10.14.6 18G95 darwin-x64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS
✗ Flutter requires a minimum Xcode version of 12.0.1.
Download the latest version or update via the Mac App Store.
! CocoaPods 1.8.4 out of date (1.10.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.39.2)
[✓] Connected device (2 available)
XCode的错误应该被忽略,因为它在过去没有引起任何问题。
这是由于构建文件夹中的中间文件中存在一些空间或java地址错误。这里有一些变通方法。
- 颤振清洁
- 从>删除生成文件夹;root/android/app/build
- 删除项目根文件夹中的生成文件夹
- 再次运行,它会起作用的
确保文件夹结构中没有空格:Gocut Cares Application
。将其更改为Gocut_Cares_Application
或类似的内容。