Gradle 从一台PC移动到另一台PC(从窗口到mac)时,颤振项目生成错误

Gradle 从一台PC移动到另一台PC(从窗口到mac)时,颤振项目生成错误,gradle,flutter,dart,Gradle,Flutter,Dart,我将颤振项目从Windows PC移动到Mac。我面临着这个错误,我也尝试扑干净,但它没有工作。运行“颤振创建”时出错 could not determine the dependencies of task app complieflutterbuilddebugarm flutter java.net.URISytaxSException Illegal character in opaque part at index 2:c:\\User\\username\\Androidst

我将颤振项目从Windows PC移动到Mac。我面临着这个错误,我也尝试扑干净,但它没有工作。运行“颤振创建”时出错

    could not determine the dependencies of task app complieflutterbuilddebugarm flutter
java.net.URISytaxSException Illegal character in opaque part at index 2:c:\\User\\username\\Androidstudioprojects\\appname\\lib\\main.dart
当我在Windows pc上创建简单的默认项目并将其移动到mac时,它工作正常,但我的大项目无法移动

FAILURE: Build failed with an exception.

* Where:
Script '/Users/admin/Desktop/fluttersdk/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 875

* What went wrong:
Could not determine the dependencies of task ':app:compileFlutterBuildDebugArm'.
> java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\\Users\\Waqas\\AndroidStudioProjects\\Naija\\lib\\main.dart

* 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 45s
Finished with error: Gradle task assembleDebug failed with exit code 1
我在运行颤振创建后得到了这个

admin@mac-mini Naija 2 % flutter create
Warning! The 'flutter' tool you are currently running is from a different Flutter repository than the one last used by this package. The repository from which the 'flutter' tool is
currently executing will be used instead.
  running Flutter tool: /Users/admin/Desktop/flutter
  previous reference  : /Users/admin/Desktop/fluttersdk/flutter
This can happen when you have multiple copies of flutter installed. Please check your system path to verify that you are running the expected version (run 'flutter --version' to see
which flutter is on your path).


No option specified for the output directory.
Create a new Flutter project.

If run on a project that already exists, this will repair the project, recreating any files that are missing.

Usage: flutter create <output directory>
-h, --help                     Print this usage information.
    --[no-]pub                 Whether to run "flutter pub get" after the project has been created.
                               (defaults to on)

    --[no-]offline             When "flutter pub get" is run by the create command, this indicates whether to run it in offline mode or not. In offline mode, it will need to have all
                               dependencies already available in the pub cache to succeed.

    --[no-]with-driver-test    Also add a flutter_driver dependency and generate a sample 'flutter drive' test.
-t, --template=<type>          Specify the type of project to create.

          [app]                (default) Generate a Flutter application.
          [package]            Generate a shareable Flutter project containing modular Dart code.
          [plugin]             Generate a shareable Flutter project containing an API in Dart code with a platform-specific implementation for Android, for iOS code, or for both.

-s, --sample=<id>              Specifies the Flutter code sample to use as the main.dart for an application. Implies --template=app. The value should be the sample ID of the desired
                               sample from the API documentation website (http://docs.flutter.dev). An example can be found at
                               https://master-api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html

    --list-samples=<path>      Specifies a JSON output file for a listing of Flutter code samples that can created with --sample.
    --[no-]overwrite           When performing operations, overwrite existing files.
    --description              The description to use for your new Flutter project. This string ends up in the pubspec.yaml file.
                               (defaults to "A new Flutter project.")

    --org                      The organization responsible for your new Flutter project, in reverse domain name notation. This string is used in Java package names and as prefix in the
                               iOS bundle identifier.
                               (defaults to "com.example")

    --project-name             The project name for this new Flutter project. This must be a valid dart package name.
-i, --ios-language             [objc, swift (default)]
-a, --android-language         [java, kotlin (default)]
    --[no-]androidx            Generate a project using the AndroidX support libraries
admin@mac-迷你Naija 2%颤振效果
警告您当前运行的“颤振”工具来自与此软件包上次使用的颤振存储库不同的颤振存储库。“颤振”工具所在的存储库
将使用当前正在执行的。
运行颤振工具:/Users/admin/Desktop/flatter
先前参考:/Users/admin/Desktop/flatterSDK/flatter
当安装了多个颤振副本时,可能会发生这种情况。请检查您的系统路径,以验证您正在运行预期的版本(运行'flatter--version'查看
在你的道路上的颤振)。
没有为输出目录指定选项。
创建一个新的颤振项目。
如果在已经存在的项目上运行,这将修复该项目,重新创建丢失的任何文件。
用法:颤振创建
-h、 --帮助打印此使用信息。
--[no-]pub是否在创建项目后运行“flatter pub get”。
(默认为on)
--[no-]脱机当create命令运行“flatter pub get”时,这表示是否在脱机模式下运行它。在脱机模式下,它需要具有所有
发布缓存中已存在依赖项以成功。
--[no-]通过驾驶员测试,还可以添加颤振驱动依赖项,并生成“颤振驱动”测试示例。
-t、 --template=指定要创建的项目类型。
[应用程序](默认)生成颤振应用程序。
[软件包]生成包含模块化Dart代码的可共享颤振项目。
[plugin]生成一个可共享的flatter项目,其中包含Dart代码中的API,并针对Android、iOS代码或两者的平台特定实现。
-s、 --sample=指定要用作应用程序main.dart的颤振代码示例。暗示--template=app。该值应为所需样本的样本ID
来自API文档网站的示例(http://docs.flutter.dev). 一个例子可以在
https://master-api.flutter.dev/flutter/widgets/SingleChildScrollView-class.html
--list samples=为可以使用--sample创建的颤振代码示例列表指定JSON输出文件。
--[否-]覆盖执行操作时,覆盖现有文件。
--描述用于新颤振项目的描述。该字符串在pubspec.yaml文件中结束。
(默认为“新颤振项目”)
--用反向域名表示法组织负责新颤振项目的组织。此字符串用于Java包名称中,并在
iOS包标识符。
(默认为“com.example”)
--project name此新颤振项目的项目名称。这必须是有效的dart包名称。
-i、 --ios语言[objc,swift(默认)]
-a、 --android语言[java,kotlin(默认)]
--[no-]androidx使用androidx支持库生成项目

不要复制.flatter插件文件 一定要跑

flutter clean

最后,如果上述方法无效,请在同一项目文件夹中尝试:

flutter create

删除
.packages
并在命令行中执行
flatter pub get

是否清理了项目?是的,但它对我不起作用。“flatter--version”是否在两个环境中给出相同的响应?我更新了问题,看看运行flatter created后得到了什么更糟糕的结果,我建议你创建一个新的项目,并转移你的代码我有多个项目要处理,所以转移代码将不好,我需要有一个坚实的解决方案,以避免在未来这样的问题哟!这对我有用。谢谢manthanks兄弟你不知道你的回答为我节省了多少时间实际上我把我的电脑从Windows7升级到了10所以我也迁移了我的项目,但它采用了我以前的项目路径
flutter create