AngeloAvv / flutter_flavorizr

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

[iOS] unable to load contents of xcfilelist #17

Closed mduruisseau closed 2 years ago

mduruisseau commented 4 years ago

Hello !

I tried to flavorize a small flutter project with two flavors, everything seems to work for Android, but I am unable to launch the app in the iOS Emulator.

I am getting these errors : error: Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug *TARGET*-input-files.xcfilelist' (in target 'Runner' from project 'Runner')

error: Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug *TARGET*-output-files.xcfilelist' (in target 'Runner' from project 'Runner')

I tried to clean the project, the pods and to rebuild everything without success. The file /ios/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug *TARGET*-input-files.xcfilelist seems to exists as I can see its content.

I didn't find any issue related to this kind of problem, could you help me understand what is going on ?

I am using Flutter 1.20.1, on macOS. Ruby, Gem and Xcodeproj are all up to date.

AngeloAvv commented 4 years ago

I need to investigate about that. I will try to setup a new project and check if everything works fine. It's possible that something has changed during the default Xcode project creation process in the last months.

AngeloAvv commented 4 years ago

Ok so I tried by flavorizing a new Flutter project starting from scratch, and it works out of the box in both Android and iOS configurations.

I need you to be a little more patient with that, because I have to create a new project and add some pods, but I need more of your intel to understand what's going on. Did you flavorized your project before or after the creation of the dependencies from cocoapods?

Maybe the files that you say are available exist in the file system but are not referenced in the project so they don't get build?

stargazing-dino commented 3 years ago

I ran into this same issue. Here were my steps:

  1. flutter create test_project
  2. Add flavors to yaml
flavorizr:
  app:
    android:
      flavorDimensions: "app"
    ios:

  flavors:
    production:
      app:
        name: "Test"
      android:
        applicationId: "com.mytest.river"
      ios:
        bundleId: "com.mytest.river"
    development:
      app:
        name: "Test Dev"
      android:
        applicationId: "com.mytest.riverdev"
      ios:
        bundleId: "com.mytest.riverdev"
  1. Add dev dependency
dev_dependencies:
  flutter_flavorizr: ^1.0.9
  1. flutter pub get
  2. Run flutter run --flavor development -t lib/main-development.dart. It works and opens the app fine.
  3. Add google_fonts to dependency list (or possibly any other library that adds native code)
  4. Now run flutter run --flavor development -t lib/main-development.dart and get previous mentioned error
stargazing-dino commented 3 years ago

In case anyone else stumbles on this, I got it working by following this comment and then fixing where the configuration files pointed to

Screen Shot 2020-11-17 at 11 54 07 AM
haithngn commented 3 years ago

@mduruisseau add this into Flutter/Debug.xcconfig

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"

and this into Flutter/Releasr.xcconfig

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
krishnakumarcn commented 3 years ago

@mduruisseau add this into Flutter/Debug.xcconfig

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"

and this into Flutter/Releasr.xcconfig

#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"

This was actually there on the Flutter/Debug.xconfig and it actually doesn't fix the problem for me. Any solution? Using flutter_flavorizr: 1.0.10 and Flutter 1.20.0

AngeloAvv commented 3 years ago

Can anyone please tell me if something has changed with flutter_flavorizr 1.0.11 ?

GianlucaDaur commented 3 years ago

Can anyone please tell me if something has changed with flutter_flavorizr 1.0.11 ?

The error persists with flutter_flavorizr 1.0.11 and 2.0.0

AngeloAvv commented 3 years ago

@GianlucaDaur can you please provide a sample project where this problem occurs?

Riddhi744 commented 3 years ago

Please add xcconfig files in ios>flutter manually. It solved my problem.

Screenshot 2021-06-01 at 7 45 07 AM Screenshot 2021-06-01 at 7 45 35 AM

Don't forget this line on the top

include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug_dev.xcconfig"

Note, it might be plugin issue, But I'm able to solve this issue by manually adding xcconfig files. Coz I have already worked with falvors without any plugin. So i tried this one and it worked like a charm .

AngeloAvv commented 3 years ago

Please add xcconfig files in ios>flutter manually. It solved my problem.

Screenshot 2021-06-01 at 7 45 07 AM Screenshot 2021-06-01 at 7 45 35 AM

Don't forget this line on the top

include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug_dev.xcconfig"

Note, it might be plugin issue, But I'm able to solve this issue by manually adding xcconfig files. Coz I have already worked with falvors without any plugin. So i tried this one and it worked like a charm .

If flutter_flavorizr didn't add a reference in the project, it means only one thing: there's something wrong with ruby or xcodeproj dependency, or simply you forgot to install them as mentioned in the README.

EhabSalah commented 3 years ago

Is there any workarounds or news about this issue ?

AngeloAvv commented 3 years ago

Is there any workarounds or news about this issue ?

I cannot reproduce it. If someone could provide a gist or a pubspec config with some steps on how to reproduce it, it would be great. The issue has been opened before Flutter 2, and once the library got migrated, a lot of stuff changed and got fixed.

hedrondantas commented 3 years ago

Update minimum target and run pod install.

Works for me. Hope it helps.

https://stackoverflow.com/questions/55505991/xcode-10-2-update-issue-build-system-error-1-unable-to-load-contents-of-file-l

tausiq commented 3 years ago

This answer worked for me. https://stackoverflow.com/a/56966495/1547738

I noticed one thing,

atik7 commented 3 years ago

Is there any workarounds or news about this issue ?

I cannot reproduce it. If someone could provide a gist or a pubspec config with some steps on how to reproduce it, it would be great. The issue has been opened before Flutter 2, and once the library got migrated, a lot of stuff changed and got fixed.

Create new flutter project, add flutter_flavorizr, and run app everything will work,

Then add connectivity_plus flutter plugins This error will come,

AngeloAvv commented 3 years ago

Is there any workarounds or news about this issue ?

I cannot reproduce it. If someone could provide a gist or a pubspec config with some steps on how to reproduce it, it would be great. The issue has been opened before Flutter 2, and once the library got migrated, a lot of stuff changed and got fixed.

Create new flutter project, add flutter_flavorizr, and run app everything will work,

Then add connectivity_plus flutter plugins This error will come,

Thanks @atik7 , I reproduced the issue.

Some of you already answered the question, it seems like an XCode build problem. In order to solve I updated the minimum target version to 12 and then I commented out the platform target version in the Podfile.

I don't know if this should be considered solved, but I can't see any other workarounds. I also think it's almost useless to reference target versions before 12: targeting 12 or above will cause 99% of the users to be fully covered.

atik7 commented 3 years ago

This answer worked for me. https://stackoverflow.com/a/56966495/1547738

I noticed one thing,

  • I renamed the generated flavors dart file. Example, lib/main-development.dart to lib/env/main_development.dart This change require fixes in all *.xcconfig files in /ios/Flutter folder In my case, FLUTTER_TARGET=lib/main-development.dart to FLUTTER_TARGET=lib/env/main_development.dart

the stackoverflow answer worked for me too, thank you!

girish54321 commented 2 years ago

Thanks, @atik7 its works now 🎉

wwnOddbit commented 2 years ago

Came across the same problem and solved it by configuring PODS_CONFIGURATION_BUILD_DIR to ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) and PODS_XCFRAMEWORKS_BUILD_DIR to $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates manually on XCode > Runner > Build Settings. Basically, pay attention to any settings related to path of Pods directories. I'm using flutter_flavorizr: ^2.1.3.

Ekeminie commented 2 years ago

Is there any workarounds or news about this issue ?

I cannot reproduce it. If someone could provide a gist or a pubspec config with some steps on how to reproduce it, it would be great. The issue has been opened before Flutter 2, and once the library got migrated, a lot of stuff changed and got fixed.

Create new flutter project, add flutter_flavorizr, and run app everything will work, Then add connectivity_plus flutter plugins This error will come,

Thanks @atik7 , I reproduced the issue.

Some of you already answered the question, it seems like an XCode build problem. In order to solve I updated the minimum target version to 12 and then I commented out the platform target version in the Podfile.

I don't know if this should be considered solved, but I can't see any other workarounds. I also think it's almost useless to reference target versions before 12: targeting 12 or above will cause 99% of the users to be fully covered.

This actually helped

Njinou commented 2 years ago
In Xcode 13 Go to General => builds phases => Bundle React Native code and images, delete every file in input files and input files lists and also in output files and output files list. as shown in the following screenshot. 
then uncheck Run script "Based on dependency analysis 
Screen Shot 2022-06-24 at 12 24 57 AM Screen Shot 2022-06-24 at 12 25 08 AM
Syed95github commented 2 years ago

Is there any workarounds or news about this issue ?

I cannot reproduce it. If someone could provide a gist or a pubspec config with some steps on how to reproduce it, it would be great. The issue has been opened before Flutter 2, and once the library got migrated, a lot of stuff changed and got fixed.

Create new flutter project, add flutter_flavorizr, and run app everything will work, Then add connectivity_plus flutter plugins This error will come,

Thanks @atik7 , I reproduced the issue.

Some of you already answered the question, it seems like an XCode build problem. In order to solve I updated the minimum target version to 12 and then I commented out the platform target version in the Podfile.

I don't know if this should be considered solved, but I can't see any other workarounds. I also think it's almost useless to reference target versions before 12: targeting 12 or above will cause 99% of the users to be fully covered.

Hi, I created application in windows then pull the code in mac, in order to run ios. I have to" flutter pub run flavorizer" command again which is bringing my changes to default. how can I keep the same code? If I run directly after calling flutter pub get, it gives me following error "Launching lib/main_turkfatura.dart on iPhone 12 in debug mode... lib/main_turkfatura.dart:1 Exception: The Xcode project does not define custom schemes. You cannot use the --flavor option."

Syed95github commented 2 years ago

Also getting this error, Error (Xcode): Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-turkfatura-input-files.xcfilelist'

Error (Xcode): Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-turkfatura-output-files.xcfilelist'

Could not build the application for the simulator. Error launching application on iPhone 12.

SirawichDev commented 1 year ago

please try this one

Came across the same problem and solved it by configuring PODS_CONFIGURATION_BUILD_DIR to ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) and PODS_XCFRAMEWORKS_BUILD_DIR to $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates manually on XCode > Runner > Build Settings. Basically, pay attention to any settings related to path of Pods directories. I'm using flutter_flavorizr: ^2.1.3.

this solution worked ~

widiu7omo commented 1 year ago

please try this one

Came across the same problem and solved it by configuring PODS_CONFIGURATION_BUILD_DIR to ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) and PODS_XCFRAMEWORKS_BUILD_DIR to $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates manually on XCode > Runner > Build Settings. Basically, pay attention to any settings related to path of Pods directories. I'm using flutter_flavorizr: ^2.1.3.

this solution worked ~

Actually, this solution is working. Thanks

Screen Shot 2023-02-26 at 16 19 36

thanhpd56 commented 1 year ago

Came across the same problem and solved it by configuring PODS_CONFIGURATION_BUILD_DIR to ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) and PODS_XCFRAMEWORKS_BUILD_DIR to $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates manually on XCode > Runner > Build Settings. Basically, pay attention to any settings related to path of Pods directories. I'm using flutter_flavorizr: ^2.1.3.

This solution worked. Thanks.

AngeloAvv commented 1 year ago

Is there any workarounds or news about this issue ?

I cannot reproduce it. If someone could provide a gist or a pubspec config with some steps on how to reproduce it, it would be great. The issue has been opened before Flutter 2, and once the library got migrated, a lot of stuff changed and got fixed.

Create new flutter project, add flutter_flavorizr, and run app everything will work, Then add connectivity_plus flutter plugins This error will come,

Thanks @atik7 , I reproduced the issue.

Some of you already answered the question, it seems like an XCode build problem. In order to solve I updated the minimum target version to 12 and then I commented out the platform target version in the Podfile.

I don't know if this should be considered solved, but I can't see any other workarounds. I also think it's almost useless to reference target versions before 12: targeting 12 or above will cause 99% of the users to be fully covered.

Upgrading/downgrading might not be necessary. By deleting Podfile.lock file, and .symlinks and Pods folder and running pub get again should fix the problem.

KM9668 commented 11 months ago

I am having this same issue still on macOS with xcode 15.0 and flutter version 13.13.0, I tested also the issue occures in the example app just by adding one package to it and building it for mac.

@AngeloAvv

KristijanMitrik commented 11 months ago

I encounter the same problem

error: Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-dev-output-files.xcfilelist' (in target 'Runner' from project 'Runner')

AngeloAvv commented 11 months ago

The solution is always the same guys. If you don't fix your cocoapods dependencies it will always fail. It's not something related with flutter_flavorizr.

KM9668 commented 11 months ago

@AngeloAvv the problem exists in the example app from your package, do you have any suggestions how to fix it ?

AngeloAvv commented 11 months ago

By deleting Podfile.lock file, and .symlinks and Pods folder and running pub get again fixes the problem.