Error (Xcode): Unable to load contents of file list: . . . ..xcfilelist
AllyTechEngineering opened this issue · 25 comments
New clean flutter project and followed the setup steps. This project will become an app that views Simpsons and The Wire characters but use one code base and just change the api data url to change the variant. Used Android Studio and VS Code and same error.
My development environment:
MacBook Pro with Apple M1 Pro chip and 16GB of memory. macOS is Sonoma version 14.0
Flutter: 3.13.6 and Dart: 3.1.3. Xcode 15.0.1 and CocoaPods version 1.13.0
It appears that Flavorizr is not setting up the Configuration Files in Xcode for each of the builds I setup. These files should be in Pods/Target Support files/Pods-Runner
Error message:
Error (Xcode): Unable to load contents of file list: '/Target Support
Files/Pods-Runner/Pods-Runner-frameworks-Debug-simpsons_char_viewer-input-files.xcfilelist'
Error (Xcode): Unable to load contents of file list: '/Target Support
Files/Pods-Runner/Pods-Runner-frameworks-Debug-simpsons_char_viewer-output-files.xcfilelist'
Could not build the application for the simulator.
Error launching application on iPhone 14 Pro.
Solution
Open the project in Xcode - see attachment one.png and two.png.
All of the new variations created by Flavorizr are missing the Configuration Files and that is causing the error (two.png).
Add Configuration Files to each of the variations created by Flavorizr (see three.png).
In Xcode build the project and then exit.
New .xcfilelist files are added to ios/Pods/Target Support Files/Pods-Runner
In the IDE flutter clean and then pub get.
In your IDE run the project variations again and it works as expected.
Source code: https://github.com/AllyTechEngineering/flavorizr_bug
this solved my issue too, thanks!
Thank you, you saved my day!
Glad to be of help - that was a real puzzler but thank God I found it.
This solution is wrong, even though for some reason it seems working.
According to the first screenshot, looks like the setup mentioned in the README has been done in the wrong way (looks like xcodeproj was missing in the first place), and then multiple runs of the flavorization process have been done to try to fix the problem.
flutter_flavorizr will create its xcfilelist according to the target and the flavor, picking the default one is wrong as you won't be able to pass extra params to the executables through these files.
Hi, thanks? I am still puzzled by your answer. I followed the guidance in the flavorizr example and readme and had the issue I reported. I then created the typical Flutter start project and setup as if in a clean project without multiple 'runs' and still got the same issue. I then went back to the project I was working on and applied my "Solution" was able to get back to work. I took the time and effort to try and document (in my original project with "multiple runs" ) so not sure where you are coming from. I don't have time to create a clean project, setup Flavorizr and then re-present the issue and document for you. I assume that somewhere I did not follow the "guidance" about how to use the package correctly and that is why the issue happened? If you would take the time to explain how my issue happened in as much detail as I explained what happened I could understand but your cryptic response is to say the least disappointing.
@AllyTechEngineering I added the Troubleshooting section in the README where I explain what are the right steps to get rid of the problem once and for all.
This has been causing me issues for some time. First on iOS, I resolved this by switching to the latest Flutter version, and deleting and re-creating ios project. However, I noticed that the issue starts to happen again whenever I run flavoritz CLI command for a second time.
Then the same issue was happening with Mac Flutter app. I managed to resolve the issue by re-creating the macos directory and running the flavoritz CLI command before I try to run the app.
The documentation provided above, helped me to figure out that any additional flavoritz CLI command ran after the initial iOS or macOS project Podfile.lock file was created, will break those projects. Which is unfortunate. But important to keep in mind.
It is mentioned in the troubleshooting doc "when you run flutter pub get, it will regenerate the Pods, but it will not regenerate the xcfilelis files which are used by XCode to compile the project.". I haven't yet tried this, but it would be a major bummer to have to deal with this issue after each library version upgrade.