简体   繁体   中英

Illegal character in opaque part at index 2

I copied flutter codes from Windows to MacOS and I am trying to run it but it runs into this error :

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

I have run flutter clean, flutter upgrade, restarted everything. Nothing works. Please help

flutter doctor output :

[✓] 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)

The error about XCode should be neglected since it hadnt caused any issues in the past.

make sure you don't have spaces in your folder structure: Gocut Cares Application . change it to Gocut_Cares_Application or something similar.

It's due to some space or wrong address of java in the intermediates in build folder. Here is some workaround.

  • flutter clean
  • delete build folder from >root/android/app/build.
  • delete the build folder in the root folder of the project.
  • run again, It will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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