【问题标题】:Flutter- fastlane with iOS multi flavorsFlutter- fastlane with iOS multi flavors
【发布时间】:2022-12-01 12:09:36
【问题描述】:

I am using Flutter with multiple flavors. I am using fastlane to automate the iOS build like below, I have multiple flavours and I have multiple main.dart variants respectively:

private_lane :build4iOS do |options|
 
  build_app(
      workspace: "./#{$project_name}.xcworkspace",
      configuration: myConfiguration,
      scheme: myScheme,
      silent: false,
      clean: true,
      export_options:{ manageAppVersionAndBuildNumber: false, method: options[:export_options] }
  )

This works perfectly fine for android as I am passing the flags: "-Ptarget=lib/main_flavor.dart" to the build cradle function as per the answer to this question: Flutter- using fastlane with android multi flavors.

However for iOS I don't know how to pass the same flag in the build_app action! All the build types pick up the same variant of main.dart

How can I set such a flag so the iOS build also points to the correct variant of main-flavour.dart

I went through the documents but could not find a sulotion also can not find any solution for this on stack overflow.

【问题讨论】:

    标签: ios flutter dart fastlane cicd


    【解决方案1】:

    I ran into this as well. The best solution I could find was to update the FLUTTER_TARGET variable in XCode to match all the flavors.

    1. Open up XCode by double clicking ios/Runner.xcworkspace
    2. Click on Runner > Build Settings
    3. Type "FLUTTER_TARGET" into the search bar and expand the FLUTTER_TARGET variable in that list
    4. Proceed to rename all the main.dart to match your flavors.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 1970-01-01
      • 2020-01-28
      • 1970-01-01
      • 1970-01-01
      • 2021-04-07
      相关资源
      最近更新 更多