AngeloAvv / flutter_flavorizr

A flutter utility to easily create flavors in your flutter application
https://pub.dev/packages/flutter_flavorizr
MIT License
456 stars 81 forks source link

.tmp/scripts/darwin/add_build_configuration.rb:23:in `<main>': undefined method `build_settings' for nil:NilClass (NoMethodError) build_config.build_settings = base_config.build_settings.clone #191

Closed duchv-nws closed 1 year ago

duchv-nws commented 1 year ago

When i run flutter pub run flutter_flavorizr -p ios:buildTargets

.tmp/scripts/darwin/add_build_configuration.rb:23:in <main>': undefined methodbuild_settings' for nil:NilClass (NoMethodError)

build_config.build_settings = base_config.build_settings.clone

I find in source lib, I don't find folder .tmp

How to fix that

xcode 14.2 flutter 3.10 ruby: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]

AngeloAvv commented 1 year ago

You cannot run ios:buildTargets on its own as it depends on other processors In this case, you also need

assets:download assets:extract

duchv-nws commented 1 year ago

@AngeloAvv I see that. But when i run flutter pub run flutter_flavorizr it have another error

.tmp/scripts/darwin/add_build_configuration.rb:23:in <main>': undefined methodbuild_settings' for nil:NilClass (NoMethodError)

build_config.build_settings = base_config.build_settings.clone

duchv-nws commented 1 year ago

When i create new flutter project. It's ok but in my old project it error. Now, i find in my project error.

duchv-nws commented 1 year ago
flavorizr:
  flavors:
    # Buyer app
    buyer_prod:
      app:
        name: "Buyer"
      android:
        applicationId: "MY_BUNNDLE_ID_APP.buyers"
        firebase:
          config: ".firebase/buyer/prod/google-services.json"
      ios:
        bundleId: "MY_BUNNDLE_ID_APP.buyers"
        firebase:
          config: ".firebase/buyer/prod/GoogleService-Info.plist"
    buyer_stg:
      app:
        name: "Buyer stg"
      android:
        applicationId: "MY_BUNNDLE_ID_APP.buyers.stg"
        firebase:
          config: ".firebase/buyer/stg/google-services.json"
      ios:
        bundleId: "MY_BUNNDLE_ID_APP.buyers.stg"
        firebase:
          config: ".firebase/buyer/stg/GoogleService-Info.plist"
    buyer_dev:
      app:
        name: "Buyer dev"
      android:
        applicationId: "MY_BUNNDLE_ID_APP.buyers.dev"
        firebase:
          config: ".firebase/buyer/dev/google-services.json"
      ios:
        bundleId: "MY_BUNNDLE_ID_APP.buyers.dev"
        firebase:
          config: ".firebase/buyer/dev/GoogleService-Info.plist"
    # Buyer app
    seller_prod:
      app:
        name: "Seller"
      android:
        applicationId: "MY_BUNNDLE_ID_APP.seller"
        firebase:
          config: ".firebase/seller/prod/google-services.json"
      ios:
        bundleId: "MY_BUNNDLE_ID_APP.seller"
        firebase:
          config: ".firebase/seller/prod/GoogleService-Info.plist"
    seller_stg:
      app:
        name: "Seller stg"
      android:
        applicationId: "MY_BUNNDLE_ID_APP.seller.stg"
        firebase:
          config: ".firebase/seller/stg/google-services.json"
      ios:
        bundleId: "MY_BUNNDLE_ID_APP.seller.stg"
        firebase:
          config: ".firebase/seller/stg/GoogleService-Info.plist"
    seller_dev:
      app:
        name: "Seller dev"
      android:
        applicationId: "MY_BUNNDLE_ID_APP.seller.dev"
        firebase:
          config: ".firebase/seller/dev/google-services.json"
      ios:
        bundleId: "MY_BUNNDLE_ID_APP.seller.dev"
        firebase:
          config: ".firebase/seller/dev/GoogleService-Info.plist"

My pubspec.yaml

duchv-nws commented 1 year ago

I found issues Because i deleted Xcode -> Configuration default (Debug, Release, Profile) But i don't know why when delete that lib run failure

congvn-nws commented 1 year ago

same issue

despie commented 5 months ago

I found issues Because i deleted Xcode -> Configuration default (Debug, Release, Profile) But i don't know why when delete that lib run failure

Yes, the same case here. This did the trick. I just opened XCode projects and added those 3 configurations by copying any other and renaming. After running dart run flutter_flavorizr, no such exception occured.