Illegal character in opaque part at index 2

Viewed 2031

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.

2 Answers

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.

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

Related