AngeloAvv / flutter_flavorizr

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

integration_test on iOS getting stuck on start #161

Open Klabauterman opened 1 year ago

Klabauterman commented 1 year ago

When having an integration test with the integration_test framwork and starting it with a flavor created by this tool, the app gets started and the console says: "Xcode build done." But then nothing happens anymore. On Android it works fine and the test runs.

It looks like many people were running into this problem: https://github.com/flutter/flutter/issues/99246

But in the flutter repo there is a flavor example that works fine: https://github.com/flutter/flutter/tree/master/dev/integration_tests/flavors

So I am pretty sure there is something wrong with the config created by this tool.

Klabauterman commented 1 year ago

I think it is because the tool overrides FLUTTER_TARGET which is used for the tests

Klabauterman commented 1 year ago

Ok, the problem are the override of FLUTTER_TARGET in the xcconfig files. They break the integration_test as integration_test sets its own FLUTTER_TARGET which gets overridden. I would suggest that it should be possible to generate flavors that don't override FLUTTER_TARGET. Using a dart define that can be added to the run or build command is much better: --dart-define=flavor=dev. We would have one main file in which we can read the value of the dart define const flavor = String.fromEnvironment('flavor')

amrgetment commented 8 months ago

@Klabauterman did you used flavor?

 flutter drive --flavor dev\
  --driver=test_driver/integration_test.dart \
  --target=integration_test/app_test.dart \
  --web-port=5000 \
  --browser-dimension=1280,1024 \
  -d chrome
mirland commented 5 months ago

Hi, if we remove the FLUTTER_TARGET the tests work as expected. So I think we should do something like that https://github.com/AngeloAvv/flutter_flavorizr/issues/120 if we make it optional, we can run the tests without issues