-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Troubleshooting: Unable to load contents of file list section i…
…n README
- Loading branch information
Showing
4 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
docs/troubleshooting/unable-to-load-contents-of-file-list/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Troubleshooting: Unable to load contents of file list | ||
|
||
This error is caused by a desynchronization between the files generated by `flutter_flavorizr` and | ||
Cocoapods. | ||
Typically, this problem occurs when you try to flavorize your project for the first time, and you | ||
have already run `pod install` before. | ||
Another common scenario is when you try to add a flutter dependency which carries Pods by its own, | ||
and you have already run `pod install` before. | ||
Since `pod install` is called under the hood by Flutter 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. | ||
|
||
## Problem | ||
|
||
When you run the `flutter run --flavor apple -t lib/main_apple.dart ` command, you get the following | ||
error: | ||
|
||
```bash | ||
Xcode build done. | ||
Failed to build iOS app | ||
Error (Xcode): Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-apple-input-files.xcfilelist' | ||
Error (Xcode): Unable to load contents of file list: '/Target Support Files/Pods-Runner/Pods-Runner-frameworks-Debug-apple-output-files.xcfilelist' | ||
|
||
Could not build the application for the simulator. | ||
Error launching application on iPhone 15 Pro Max. | ||
``` | ||
|
||
## Solution | ||
|
||
First, we need to clean the project. To do so, run the following command: | ||
|
||
```bash | ||
flutter clean | ||
``` | ||
|
||
Then, we need to manually deintegrate the pods from the project. To do so, run the following | ||
command: | ||
|
||
```bash | ||
cd ios && pod deintegrate | ||
``` | ||
|
||
Make sure that `ios/Pods`, `ios/.symlinks` folder and `ios/Podfile.lock` file have been removed. If | ||
not, remove it manually by running. | ||
|
||
```bash | ||
rm -rf ios/Pods ios/.symlinks ios/Podfile.lock | ||
``` | ||
|
||
Before running `pod install` again, we need to make sure that the XCode Workspace is targeting at | ||
least iOS 12.0. To do so, open the `ios/Runner.xcworkspace` file with XCode, and select the `Runner` | ||
project in the left panel. Then, select the `Runner` target, and go to the `General` tab. In | ||
the `Minimum Deployments` section, make sure that the `Deployment Target` is set to at least `12.0`. | ||
|
||
![runner_target.png](runner_target.png) | ||
|
||
Also, you need to make sure that the `Runner` target is selected in the `Runner` project. To do so, | ||
open the `ios/Runner.xcworkspace` file with XCode, and select the `Runner` | ||
project in the left panel. Then, select the `Runner` project, and go to the `Info` tab. In | ||
the `iOS Deployment Target` section, make sure that the `Deployment Target` is set to at | ||
least `12.0`. | ||
|
||
![runner_project.png](runner_project.png) | ||
|
||
This will ensure that XCode will use the newer linking behavior introduced for iOS 12.0. | ||
|
||
Now we're ready to run `flutter pub get` again in order to regenerate the Pods. To do so, run the | ||
following command: | ||
|
||
```bash | ||
flutter pub get | ||
``` | ||
|
||
Finally, we can run the `flutter run --flavor apple -t lib/main_apple.dart ` command again, and the | ||
app should run properly. | ||
|
||
This is the proper way to really fix this problem. Other workarounds may work because they are | ||
basically regenerating the Pods as a side effect. However, they are not guaranteed to work, and | ||
they may cause other problems in the future, especially during the deployment phase of the | ||
artifacts. | ||
|
||
## macOS | ||
|
||
This problem may also occur on macOS. The solution is the same, but you need to run the commands | ||
from the root of the project, and you need to replace `ios` with `macos` in the commands and target | ||
a higher version of macOS. Typycally, you need to target at least `11` for the `macos` target to | ||
solve this problem. |
Binary file added
BIN
+91.9 KB
docs/troubleshooting/unable-to-load-contents-of-file-list/runner_project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+123 KB
docs/troubleshooting/unable-to-load-contents-of-file-list/runner_target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.