Uncaught NSInvalidArgumentException when using Google Sign In for iOS
What's going on is that the Google SDK is retrieving your client configuration from the dictionary in GoogleService-Info.plist
but it most likely is not finding any configurations or is not able to find the file.
When you call [[GGLContext sharedInstance] configureWithError: ..
, e.g.:
NSError* configureError;
[[GGLContext sharedInstance] configureWithError: &configureError];
The code parses your client ID from the Google-ServiceInfo.plist
file, which you should add to a supporting files
or other shared resources folder, and then checks that you have also added a URI for the reversed client ID, which is pulled from the plist dictionary.
First of all, if you don't have this file, generate it by following the wizard on the new Enable Google services for your app page.
Next, make sure that you're copying the GoogleService-Info.plist file as a resource in your Xcode project in the build phases
section. When you have successfully added it to your project (usually best added in a Shared Resources section) the error message will no longer indicate a null URI is required.
Finally, make sure that you have added the bundle ID and reversed client ID in your application's URLs - which should be easy to do because the error message will tell you what's missing at this point.
If all this is still giving you trouble, you might want to try Google Sign-In for iOS using the quickstart sample by running:
pod try Google
And starting from the SignInExample.xcodeproject sample...
NSInvalidArgumentException from OIDAuthorizationService when using google signin in SwiftUI
The method that is being called, is present in this file.
If your runtime can not find this method, it means that this file is not included into the project.
If you are using CocoaPods, this file should be automatically included for ios
platform. Please insure that you specify
platform :ios, '13.0'
in your Podfile
.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean length]
As i'm not used to iOS - Swift - Xcode ecosystem took me a while to figure this out, the Xcode logs were a bit confusing to me. After reading issues on GitHub this popped out and had something related with my console message What should be the domainNetworkPolicy while using flutter in existing iOS App
This made me realize that was something with the Info.plist file.
The problem was the package flutter_webview_plugin
and with its configuration on iOS. The XML code was wrong after updating.
This is the correct XML, thanks to vanelizarov:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>url.com.br</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
Google Sign In Exception Error swift
Write Client ID in applicationdidfinish method of AppDelegate class or in viewDidLoad before the google signin delegating self.
Related Topics
Uicollectionview - Horizontal Paging with One Cell at a Time
Swift4: Callback Url Not Approved for This Client Application
Wkwebview Allowslinkpreview to False Breaks Text Selection
iOS: Is Possible to Rounder Radius with Different Value in Each Corner
Cocos2D Sprite Repeat Animation Forever
I Get Nil When Using Nsdateformatter in Swift
Calculate Controlpoints While Drawing in iOS
Two Button Simultaneous Press Input
Change Cell Height by The Content of The Textview Inside The Cell
Apn Custom Notification Sound Issue
How Come My Drawing Code Keeps Resulting in Fuzzy Shapes
Populating Input Text Field in Wkwebview
Swiftui: Navigate to Home Screen After Login Completed. Navigating Views by Button Click
Selecting All The Items in UIcollectionview iOS, Even The Cells That Are Not Visible
Selecting All The Items in UIcollectionview iOS, Even The Cells That Are Not Visible
iOS - Running Background Task for Update User Location Using Swift
How to Programmatically Wrap Png Texture Around Cube in Scenekit