danwilson / google-analytics-plugin

Cordova (PhoneGap) Plugin to connect to the native Google's Universal Analytics SDK 3.0
MIT License
693 stars 500 forks source link

fatal error: 'GoogleAnalytics/GAI.h' file not found #import <GoogleAnalytics/GAI.h> #582

Closed rpragesh closed 2 years ago

rpragesh commented 3 years ago

I am building an ionic 4 application and using "cordova-plugin-google-analytics": "^1.9.0" plugin and when I try to build iOS app it throws 'GoogleAnalytics/GAI.h' file not found error. I tried downgrade plugin to version 1.8.6 but not working.

I get this issue when trying to build the app in build pipeline in azure devops. should I need to change to a specific version?

billb037 commented 3 years ago

I'm having the exact same issue. building in Xcode throws this error.

.../platforms/ios/BolinCustomerPortal/Plugins/cordova-plugin-google-analytics/UniversalAnalyticsPlugin.h:6:9: 'GoogleAnalytics/GAI.h' file not found

gaurav112 commented 3 years ago

Have this same issue, somehow the GoogleAnalytics dependency isn't getting installed.

Workaround: edit config.xml and add `

` hope this helps

shindenitish commented 3 years ago

Have this same issue, somehow the GoogleAnalytics dependency isn't getting installed.

Workaround: edit config.xml and add <platform name="ios"> <pod name="GoogleAnalytics" version="3.17.0" /> </platform> hope this helps

Hey @gaurav112 I tried this, even switched to latest cordova ios platform, but still got the error with GAI.h. Maybe I'm missing something, can you explain what's the probable cause for this error. So that we can get clear understanding while debugging.

gaurav112 commented 3 years ago

@shindenitish the probable cause is "GoogleAnalytics" dependency not getting installed via pods. However, you can open XCode and add "GoogleAnalytics" in your pod file, that isn't a fix but a hack.

victorsosa commented 2 years ago

PR https://github.com/danwilson/google-analytics-plugin/pull/594 created