1

I am trying to add the Google-Service.json (for Google Social Login) to my Xcode Project. As the project is build in a CI machine I cannot do it through Xcode.

I used Cocoapod's Xcodeproj package in order to help me add the json to my Xcode proj. The Runner folder seen below is not a group folder as Fluter or Products. With my created script I only achieve for the file to be added to the root of the project as seen in the picture. Can anyone tell me what to change so the project gets inside the Runner folder (as requested from Google_sign_in flutter plugin)

enter image description here

Here is my script:

require "xcodeproj"

project_path = "Runner.xcodeproj"

project = Xcodeproj::Project.open(project_path)


file = project.new_file("Google.json", "Runner")
main_target = project.targets.first
main_target.add_resources([file])

project.save

Thanks for any inputs

1 Answers1

0

Don't know if it is still relevant. BUT i stumbled upon the same issue.

You need to add them inside the project root with ruby's FileUtils first.

FileUtils.cp(File.path(config_path), 'Runner')

I made a GitHub Gist with the whole script. With an example of my Run script also.