cordova-plugin-googleplus
cordova-plugin-googleplus copied to clipboard
iOS build failed - missing .h file
In the version 8.0.0
building iOS fails with error:
/Plugins/cordova-plugin-googleplus/GooglePlus.h:2:9: fatal error: 'GoogleSignIn/GoogleSignIn.h' file not found
#import <GoogleSignIn/GoogleSignIn.h>
In the version 7.0.2
it builds normally.
Same error as in #501 .
+1
You need to install cocoapods. It looks like the latest version of the plugin requires it. I got caught out with this too... Have a look at the section on cocoapods in the latest readme
EDIT: Even after installing cocoapods, I can't build with errors like The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Turns out I needed to run pod setup
and have Cordova 9
I tried updating cocoapods 1.7.5 but the problem still remains.
+1
A temporary fix I found was to install the plugin cordova-plugin-cocoapod-support and then add for the ios platform the following preferences
<preference name="pods_ios_min_version" value="9.0" />
<preference name="pods_use_frameworks" value="true" />
<pod name="GoogleSignIn" version="4.4.0" />
This was based on the conflict fix with firebase #553
It's possible that I may have needed to run pod setup
to initaliase cocoapods... It takes about 15 minutes to run this as it seems to clone a gigantic repo...
If you are using https://github.com/phonegap/phonegap-cli you need a version with cordova@9 to for it to pick up on the pod stuff.
I did a PR to fix this here https://github.com/phonegap/phonegap-cli/pull/815
You will also need the latest version of cocoapods and latest version of pods. You can update this by running gem install cocoapods
and pod setup
.
Having the same issue. Installed cocoapods, ran pod setup
inside of /platforms/ios
, run pod init
inside of that same folder (which created a Podfile
file without any dependencies in it).
Should I put anything inside of Podfile
?
I've been in Cordova 9 all along.
@fariazz I didn't bother with the pod init
... try run cordova build ios
before opening the xcworkspace (not xcodeproj). All worked for me.
I'm using cordova-plugin-firebasex along with this plugin too
try run
cordova build ios
before opening the xcworkspace (not xcodeproj). All worked for me.
Thanks that is the part I was missing. I've nuked my platforms
folder, added the ios platform, cordova build ios
before opening the xcworkspace file, and it builds successfully.
Once I then open the xcworkspace file (I do need to make some changes there), if by any chance I clean the build folder (Product - Clean Build Folder), and build again in XCode I encounter the missing .h file error.
I think we need to manually add a Podfile to the ios
folder with some content (or should this have been created automatically by Cordova?), but I'm not very familiar with the XCode / Mac dev environment. I feel like there is a step missing in the docs for this plugin.
It says in there that we can list the dependencies by typing pod dependencies
inside of platforms/ios
, but when I do that I don't see any:
MacBooks-MacBook-Air:ios fariazz$ pod dependencies
Calculating dependencies
[!] No `Podfile' found in the project directory.
+1..
I tried everything but nothing works. I finally installed version 7.0.2 (cordova-plugin-googleplus ":" ^ 7.0.2). And now everything works.
had the same problem here, KarimZghali you got it!!! "cordova-plugin-googleplus ":" ^ 7.0.2" finally solved the problem, you saved my day KarimZghali :)
Might be related/duplicated by https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/632
I think that if you didn't notice the error while installing the platform as described in #632 then you might end up with the above error at build time
Hi @peterpeterparker. I can confirm that your patch in #632 solved this problem. However, the error described in #632 is not present in my logs. Thanks
Thx for the feedback @flamders 👍
That's good news, means the patch might solve two issues at once 😉
I tried everything but nothing works. I finally installed version 7.0.2 (cordova-plugin-googleplus ":" ^ 7.0.2). And now everything works.
Thanks, this way solved my issue
Using 7.0.2 was the only solution with Cordova 8.1.2
I had this issue for a while, downgrading to 7.0.2 fixed it but that didn't seem optimal. Turns out upgrading to the latest ionic-cli 6.2.0 (because I am using ionic), cordova 9.0.0 and cordova-ios 5.1.1 then removing and re-adding the ios platform solved all of my podfile woes for both this plugin and facebook4. Hopefully this helps someone.
after working around, I've got a working solution. All you have to define a google version for this.
ionic cordova plugin add [email protected] --save --variable REVERSED_CLIENT_ID=com.xxxxxx.mobile --variable WEB_APPLICATION_CLIENT_ID=3650100XXXXX-qtr14nvvtbek1bddr152XXXXXXX.apps.googleusercontent.com