cordova-plugin-googleplus icon indicating copy to clipboard operation
cordova-plugin-googleplus copied to clipboard

iOS build failed - missing .h file

Open AndrejHafner opened this issue 4 years ago • 20 comments

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 .

AndrejHafner avatar Jul 29 '19 08:07 AndrejHafner

+1

deliverymanager avatar Jul 29 '19 15:07 deliverymanager

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

jpduckwo avatar Jul 30 '19 03:07 jpduckwo

I tried updating cocoapods 1.7.5 but the problem still remains.

deliverymanager avatar Jul 30 '19 07:07 deliverymanager

+1

laneli avatar Jul 30 '19 08:07 laneli

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

deliverymanager avatar Jul 30 '19 09:07 deliverymanager

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...

jpduckwo avatar Jul 31 '19 11:07 jpduckwo

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.

AdriVanHoudt avatar Jul 31 '19 13:07 AdriVanHoudt

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 avatar Aug 01 '19 23:08 fariazz

@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

jpduckwo avatar Aug 01 '19 23:08 jpduckwo

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.

fariazz avatar Aug 03 '19 04:08 fariazz

+1..

minchemo avatar Aug 05 '19 13:08 minchemo

I tried everything but nothing works. I finally installed version 7.0.2 (cordova-plugin-googleplus ":" ^ 7.0.2). And now everything works.

KarimZghali avatar Aug 18 '19 11:08 KarimZghali

had the same problem here, KarimZghali you got it!!! "cordova-plugin-googleplus ":" ^ 7.0.2" finally solved the problem, you saved my day KarimZghali :)

orelnatan-zz avatar Aug 20 '19 07:08 orelnatan-zz

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

peterpeterparker avatar Aug 23 '19 07:08 peterpeterparker

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

flamders avatar Sep 06 '19 14:09 flamders

Thx for the feedback @flamders 👍

That's good news, means the patch might solve two issues at once 😉

peterpeterparker avatar Sep 06 '19 14:09 peterpeterparker

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

hvallenilla avatar Oct 13 '19 14:10 hvallenilla

Using 7.0.2 was the only solution with Cordova 8.1.2

mirko77 avatar Nov 19 '19 17:11 mirko77

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.

mqdeandrade avatar Mar 09 '20 14:03 mqdeandrade

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

menusha95 avatar Jan 19 '21 01:01 menusha95