jonataslaw / get_cli

Official Getx CLI
Apache License 2.0
578 stars 164 forks source link

Failed to create project on M2 Macbook Air #224

Open tom-xy opened 1 year ago

tom-xy commented 1 year ago

Macbook Air 2022, M2 chip. get_cli version: 1.8.4

$ get create project:app

1) Flutter Project 2) Get Server Select which type of project you want to create ? [1] What is your company's domain? Example: com.yourcompany You must enter a value. What is your company's domain? Example: com.yourcompany com.example

1) Swift 2) Objective-C what language do you want to use on ios? [1]

1) Kotlin 2) Java what language do you want to use on android? [1]

1) Yes! 2) No Do you want to use null safe? [1]

1) yes 2) no do you want to use some linter? [1]

Running flutter create /Users/tom/Downloads/app

$ flutter create --no-pub -i swift -a kotlin --org com.example /Users/.../Downloads/app Creating project .... Wrote 129 files.

All done! You can find general documentation for Flutter at: https://docs.flutter.dev/ Detailed API documentation is available at: https://api.flutter.dev/ If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

$ cd . $ flutter run

Your application code is in ./lib/main.dart.

Running flutter pub get

$ flutter pub get Resolving dependencies...

Usage: dart <command|dart-file> [arguments]

Global options: -v, --verbose Show additional command output. --version Print the Dart SDK version. --enable-analytics Enable analytics. --disable-analytics Disable analytics. --suppress-analytics Disallow analytics for this dart * run without changing the analytics configuration. -h, --help Print this usage information.

Available commands: analyze Analyze Dart code in a directory. compile Compile Dart to various formats. create Create a new Dart project. devtools Open DevTools (optionally connecting to an existing application). doc Generate API documentation for Dart projects. fix Apply automated fixes to Dart source code. format Idiomatically format Dart source code. info Show diagnostic information about the installed tooling. pub Work with packages. run Run a Dart program. test Run tests for a project.

Run "dart help " for more information about a command. See https://dart.dev/tools/dart-tool for detailed documentation. ✖ + error_unexpected ShellException(dart migrate --apply-changes --skip-import-check, exitCode 64, workingDirectory: /Users/.../Downloads/app)

tom-xy commented 1 year ago

To avoid the failure, removed some code in shel.utils.dart

Step 1: Open shel.utils.dart

$ code $HOME/.pub-cache/hosted/pub.dev/get_cli-1.8.4/lib/common/utils/shell/shel.utils.dart

Step 2: Remove code

static Future activatedNullSafe() async { await pubGet(); // Remove code below // await run('dart migrate --apply-changes --skip-import-check', // verbose: true); }

Step 3: Re-activate get_cli

$ flutter pub global deactivate get_cli $ flutter pub global activate get_cli

tobias-minaffarstv commented 1 year ago

For those on Windows, the file is located here:

C:\Users\<USERNAME>\AppData\Local\Pub\Cache\hosted\pub.dev\get_cli-1.8.4\lib\common\utils\shell\shel.utils.dart

Oxydork commented 12 months ago

thanks for all the help

gemgao commented 8 months ago

Thank you. It works for me