1.问题
在使用 flutter create
命令创建flutter
工程时,如果报`Cannot create a project within the Flutter SDK. Target directory ‘/Users/ksnowlv/Music/flutter/flutter/my_app’ is within the Flutter SDK at
‘/Users/ksnowlv/Music/flutter/flutter’的错误。
2.解决方案
注意不要在flutter SDK
目录及子目录下创建工程,可考虑在其它目录下创建工程。例如平级目录
实际操作如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
ksnowlvdeMacBook-Pro:flutter ksnowlv$ ./flutter/bin/flutter create my_app
Creating project my_app...
my_app/ios/Runner.xcworkspace/contents.xcworkspacedata (created)
my_app/ios/Runner/Info.plist (created)
my_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png (created)
my_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png (created)
my_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md (created)
my_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json (created)
my_app/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png (created)
my_app/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png (created)
my_app/ios/Runner/Base.lproj/LaunchScreen.storyboard (created)
my_app/ios/Runner/Base.lproj/Main.storyboard (created)
my_app/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata (created)
my_app/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme (created)
my_app/ios/Flutter/Debug.xcconfig (created)
my_app/ios/Flutter/Release.xcconfig (created)
my_app/ios/Flutter/AppFrameworkInfo.plist (created)
my_app/test/widget_test.dart (created)
my_app/my_app.iml (created)
my_app/.gitignore (created)
my_app/.metadata (created)
my_app/ios/Runner/AppDelegate.h (created)
my_app/ios/Runner/main.m (created)
my_app/ios/Runner/AppDelegate.m (created)
my_app/ios/Runner.xcodeproj/project.pbxproj (created)
my_app/android/app/src/profile/AndroidManifest.xml (created)
my_app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (created)
my_app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (created)
my_app/android/app/src/main/res/drawable/launch_background.xml (created)
my_app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (created)
my_app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (created)
my_app/android/app/src/main/res/values/styles.xml (created)
my_app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (created)
my_app/android/app/src/main/AndroidManifest.xml (created)
my_app/android/app/src/debug/AndroidManifest.xml (created)
my_app/android/gradle/wrapper/gradle-wrapper.properties (created)
my_app/android/gradle.properties (created)
my_app/android/settings.gradle (created)
my_app/pubspec.yaml (created)
my_app/README.md (created)
my_app/lib/main.dart (created)
my_app/android/app/build.gradle (created)
my_app/android/app/src/main/java/com/example/my_app/MainActivity.java (created)
my_app/android/build.gradle (created)
my_app/android/my_app_android.iml (created)
my_app/.idea/runConfigurations/main_dart.xml (created)
my_app/.idea/libraries/Flutter_for_Android.xml (created)
my_app/.idea/libraries/Dart_SDK.xml (created)
my_app/.idea/libraries/KotlinJavaRuntime.xml (created)
my_app/.idea/modules.xml (created)
my_app/.idea/workspace.xml (created)
Running "flutter packages get" in my_app... 5.7s
Wrote 66 files.
All done!
[✓] Flutter is fully installed. (Channel dev, v1.6.0, on Mac OS X 10.14.4 18E226, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices is partially installed; more components are available. (Android SDK version 28.0.3)
[!] iOS toolchain - develop for iOS devices is partially installed; more components are available. (Xcode 10.2.1)
[!] Android Studio is partially installed; more components are available. (version 3.4)
[!] Connected device is not available.
Run "flutter doctor" for information about installing additional components.
In order to run your application, type:
$ cd my_app
$ flutter run
Your application code is in my_app/lib/main.dart.
ksnowlvdeMacBook-Pro:flutter ksnowlv$
|
文章作者
梵梵爸
上次更新
2019-05-22
许可协议
原创文章,如需转载请注明文章作者和出处。谢谢