Closed RoyZengTW closed 1 year ago
Delete the section below, reopen terminal and run flutter pub run flutter_flavorizr
again.
flavorDimensions "app"
productFlavors {
dev {
applicationIdSuffix ".dev"
}
prod {
}
}
Thanks for replying. After I delete the section. I got another error
Executing task flutter:targets
Running FlutterTargetFileProcessor
Running Copying file from .tmp/flutter/main_target.dart to lib/main_dev.dart
Running FileProcessor: creating file lib/main_dev.dart with nested ReplaceStringProcessor: replacing [[FLAVOR_NAME]] with dev
Running FlutterTargetFileProcessor
Running Copying file from .tmp/flutter/main_target.dart to lib/main_prod.dart
Running FileProcessor: creating file lib/main_prod.dart with nested ReplaceStringProcessor: replacing [[FLAVOR_NAME]] with prod
Executing task ios:xcconfig
Running IOSXCConfigFileProcessor
Running IOSXCConfigModeFileProcessor
Running FileProcessor: writing file ios/Flutter/devDebug.xcconfig with nested IOSXCConfigProcessor
Running ShellProcessor: Running script 'ruby' with arguments .tmp/scripts/darwin/add_file.rb, ios/Runner.xcodeproj, Flutter/devDebug.xcconfig, Flutter
Unhandled exception:
ProcessException: 系統找不到指定的檔案。
Command: ruby .tmp/scripts/darwin/add_file.rb ios/Runner.xcodeproj Flutter/devDebug.xcconfig Flutter
#0 _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:487:7)
#1 _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:632:18)
#2 Process.runSync (dart:io-patch/process_patch.dart:68:12)
#3 ShellProcessor.execute (package:flutter_flavorizr/src/processors/commons/shell_processor.dart:45:36)
#4 QueueProcessor.execute (package:flutter_flavorizr/src/processors/commons/queue_processor.dart:44:17)
#5 QueueProcessor.execute (package:flutter_flavorizr/src/processors/commons/queue_processor.dart:44:17)
#6 QueueProcessor.execute (package:flutter_flavorizr/src/processors/commons/queue_processor.dart:44:17)
#7 Processor.execute (package:flutter_flavorizr/src/processors/processor.dart:139:24)
The android part seems success and ios is fail. How do I fix the error? Thanks.
After I install Ruby,Gem and Xcodeproj. It works fine. Thank you.
After I add the flavorizr in pubspec.yaml, I run flutter pub run flutter_flavorizr in terminal. I got error
Executing task android:buildGradle Unhandled exception: The following resource contains existing flavor dimensions:
. Please delete the whole section before running flutter_flavorizr again.
.0 AndroidBuildGradleProcessor.execute (package:flutter_flavorizr/processors/android/android_build_gradle_processor.dart:67:7)
.1 AbstractFileStringProcessor.execute (package:flutter_flavorizr/processors/commons/abstract_file_string_processor.dart:41:31)
.2 Processor.execute (package:flutter_flavorizr/processors/processor.dart:116:24)
pub finished with exit code 255
Is someone has the same error? How do I fix this? Thanks.