【发布时间】:2020-03-07 07:20:39
【问题描述】:
我将颤振项目从窗口 PC 移动到 Mac。我正面临这个错误,我也尝试过flutter clean,但它不起作用。运行 flutter create 时出错。
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
我在运行 flutter create 后得到了这个
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
【问题讨论】:
-
你清理你的项目了吗?
-
是的,我做到了,但它对我不起作用。
-
“flutter --version”对两种环境的响应是否相同?