Could not find a valid GoogleService-Info.plist in your project
Remove the Google-Info.plist
file from your project and try to add it from your project folder's option menu.
EDIT:
this is how you remove a plist file
Xcode 10 Error: Multiple commands produce
Could not find a valid GoogleService-lnfo.plist
Make sure your plist file is:
- Downloaded from your Firebase project
- Added to Copy Bundle Resources (Choose your target -> Build Phase -> Copy Bundle Resources)
Or try to add that file from Menu as below
I see the log states that No app has been configured yet.
Let's try add these lines of code in the beginning of your AppDelegate
if FirebaseApp.app() == nil {
let path = Bundle.main.path(forResource: "GoogleService-Info", ofType: "plist")
let firbaseOptions = FirebaseOptions(contentsOfFile: path!)
FirebaseApp.configure(options: firbaseOptions!)
}
Could not find a valid GoogleService-Info.plist after handle different configuration in Build phrase
I believe there are multiple issues in your approach
Issue 1:
I believe simply copying the file to the folder will not help, you need to add the file to project and change its target membership to the specific target you are running. You need to add the file to Copy Bundle Resources in build phase of specific target you are running with.
Issue 2:
Also though you have changed the filename of GoogleService-info.plist
name Firebase is still looking for GoogleService-info.plist
and not your renamed file hence the crash.
As mentioned here github.com/firebase/quickstart-ios/issues/5 you can not change the filename, file has to be named as GoogleService-info.plist. So copying entire file would not work.
Probable Solution:
Rather than copying the file what you can do is have a empty plist file named GoogleService-info.plist
make sure you have its target membership correctly ticked and also added to Copy Bundle Resource of your target. Copy other GoogleService-Info-Configuration.plist file as well to your project.
Then, in your run script, read the content from specific GoogleService-Info-{Configuration}.plist and simply copy the content of file to your GoogleService-info.plist
Using something like
cat "${SRCROOT}/Test/Resourses/Firebase/GoogleService-Info-$CONFIGURATION.plist" > "${SRCROOT}/Test/Resourses/Firebase/GoogleService-Info.plist"
Or as OP mentioned in his comment use
cp "${SRCROOT}/Turf/Resourses/Firebase/GoogleService-Info-$CONFIGURATION.plist" "${SRCROOT}/Turf/Resourses/Firebase/GoogleService-Info.plist"
I have not tested above pasted shell Script, though it should give you fairly simple idea how to approach the problem.
Flutter Desktop: Firebase Auth could not find a valid GoogleService-Info.plist
Solved I was adding it to the iOS folder instead of the MacOS folder.
Remember to allow incoming and outgoing connections in the xcode.
Otherwise it will not work for them.
They must put the file inside the resource folder.
Xcode doesn't recognize GoogleService-Info.plist file after adding Firebase via pods
It happens to me. Just erase the (7). The Xcode firebase framework connects to firebase through the GoogleService-Info.plist
when you build your code an error will be display if the .plist file is not called exactly: GoogleService-Info.plist
. At the moment that the .plist file has another character in the name, the firebase framework will not recognize it. The framework is searching just for the GoogleService-Info.plist not GoogleService-Info.plist (07)
This usually happens when you download several times your GoogleService-Info.plist
from the console. If you want to avoid this. Get the file out from your "downloads" carpet. Otherwise, your computer is going to add a number at the end of the name file if you already have one inside that carpet. It creates a copy.
Hope this can help!
Unable to find GoogleService-Info.plist while trying to integrate Google Sign-in in my app
I faced the same problem. And, actually, I solved it when in cocoapods file I placed "pod 'Google/SignIn'" instead of "pod Google". Hope it could help you too.
Use different GoogleService-Info.plist for single project in xcode using swift4
I got the solution. I renamed GoogleService-Info.plists files by its respective environments. And Added those files in Build Phases -> Copy Bundle Resources. Then added the following code as per the environment selected
guard let plistPath = Bundle.main.path(forResource: "nameOfTheGoogleService-Info.plistFileAsPerTheEnvironment", ofType: "plist"),
let options = FirebaseOptions(contentsOfFile: plistPath)
else { return }
if FirebaseApp.app() == nil{
FirebaseApp.configure(options: options)
}
Minor change is that, when user changes the app's environment, then he should remove app from background and open it again. Then the AppDeleagte takes the path of respective GoogleService-Info.plist as per its environment selected
Related Topics
How to Check If iOS App Is in Background
Ios: Place Uiview on Top of Uitableview in Fixed Position
Compare Two Version Strings in Swift
How to Check If a Uialertcontroller Is Already Presenting
Black Screen After Presenting Modal View Controller in Current Context from Uitabbarcontroller
How to Set Uiviewcontroller "Extend Edges" Properties
Issue with Auto Layout on iOS 8 (Code Works Perfectly on iOS 7)
Allowing Single Digit in Uitextfield in iOS
Using Collectionview in Uiview with Xib File
Getting Video Snapshot for Thumbnail
How to Calculate the Height of an Nsattributedstring with Given Width in iOS 6
App Crashes on Enabling Camera Access from Settings iOS 8