flutter_flavorizr
flutter_flavorizr copied to clipboard
Multiple commands produce GoogleService-Info.plist
Hi, I have 2 different flavors with different firebase configs. It works flawlessly in Android.
But I can't able to build the app in Xcode as it throws Multiple commands produce GoogleService-Info.plist
error. Heres the error
Multiple commands produce '/Users/rameshvel/Library/Developer/Xcode/DerivedData/Runner-gqmldwjuahwuwkgijmfokisjscam/Build/Products/Debug-AppleApp-iphonesimulator/Runner.app/GoogleService-Info.plist':
1) Target 'Runner' (project 'Runner') has copy command from '/Users/rameshvel/work/storeJam/modernkirana/apps/customer/ios/Runner/OrangeApp/GoogleService-Info.plist' to '/Users/rameshvel/Library/Developer/Xcode/DerivedData/Runner-gqmldwjuahwuwkgijmfokisjscam/Build/Products/Debug-AppleApp-iphonesimulator/Runner.app/GoogleService-Info.plist'
2) Target 'Runner' (project 'Runner') has copy command from '/Users/rameshvel/work/storeJam/modernkirana/apps/customer/ios/Runner/AppleApp/GoogleService-Info.plist' to '/Users/rameshvel/Library/Developer/Xcode/DerivedData/Runner-gqmldwjuahwuwkgijmfokisjscam/Build/Products/Debug-AppleApp-iphonesimulator/Runner.app/GoogleService-Info.plist'
A quick look at the copy bundle resource
in the build phase
revealed that flutter_flavorizr added a copy phase for GoogleService-Info.plist
for both the flavors.
I know I can remove just a unused flavor and add it back when I am building that one. Is there a simple way?
Hi @Rameshv , this looks weird. flutter_flavorizr checks if a previously defined build phase was there, and if so, it removes it and readds with the updated references. Maybe you previously customized the name of the "Firebase Setup" script?
Hi @Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
Thank you @Cyril212 , this solved my problem also.
Hi @Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
great bro, tks
Hi @Rameshv , this looks weird. flutter_flavorizr checks if a previously defined build phase was there, and if so, it removes it and readds with the updated references. Maybe you previously customized the name of the "Firebase Setup" script?
Thank you this solve my problem
Thank you @Cyril212 , this solved my problem also.
Hi @Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
u are my hero 😄
Hi @Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
What do you mean I do not understand.
Hi @Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
What do you mean I do not understand.
Here's how you can do that:
- Open your Xcode project.
- In the left-hand navigation pane, select your project to open the project editor.
- In the project editor, select your target.
- Select the "Build Phases" tab.
- Expand the "Copy Bundle Resources" section.
- Look for any references to GoogleService-Info.plist in the list of resources. You can identify it by its icon, which should look like a blue file with a white "G" on it.
- If you find any references to GoogleService-Info.plist, select them and press the "-" button to remove them from the list.
- Repeat step 7 for any additional references to GoogleService-Info.plist.
- Once you have removed all references to GoogleService-Info.plist from the "Copy Bundle Resources" build phase, save your changes and try building your Xcode project again.
By removing all references to GoogleService-Info.plist from the "Copy Bundle Resources" build phase, you are ensuring that Xcode does not try to copy the file to the app bundle more than once, which can cause conflicts and errors like the one described in the GitHub issue.
Hi @Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
What do you mean I do not understand.
Here's how you can do that:
- Open your Xcode project.
- In the left-hand navigation pane, select your project to open the project editor.
- In the project editor, select your target.
- Select the "Build Phases" tab.
- Expand the "Copy Bundle Resources" section.
- Look for any references to GoogleService-Info.plist in the list of resources. You can identify it by its icon, which should look like a blue file with a white "G" on it.
- If you find any references to GoogleService-Info.plist, select them and press the "-" button to remove them from the list.
- Repeat step 7 for any additional references to GoogleService-Info.plist.
- Once you have removed all references to GoogleService-Info.plist from the "Copy Bundle Resources" build phase, save your changes and try building your Xcode project again.
By removing all references to GoogleService-Info.plist from the "Copy Bundle Resources" build phase, you are ensuring that Xcode does not try to copy the file to the app bundle more than once, which can cause conflicts and errors like the one described in the GitHub issue.
thanks it works
@Rameshv, I had the same problem, try to remove all references to GoogleService-Info.plist in Build Phases -> Copy Bundle Resources.
Hi, I had the same issue and I did this solution but if I remove these references, I get this error while building using vscode with a launch.json configuration: Error (Xcode): lib/main.dart: Error: Error when reading 'lib/main.dart': No such file or directory
Here is my launch.json: "configurations": [ { "name": "my-app dev", "request": "launch", "type": "dart", "program": "lib/main_development.dart", "args": [ "--target", "lib/main_development.dart", "--flavor", "development",] }, { "name": "my-app staging", "request": "launch", "type": "dart", "program": "lib/main_staging.dart", "args": [ "--target", "lib/main_staging.dart", "--flavor", "staging",] }, { "name": "my-app production", "request": "launch", "type": "dart", "program": "lib/main_production.dart", "args": [ "--target", "lib/main_production.dart", "--flavor", "production",] } ] }
@Cyril212 Thanks for the reply It worked for me