larpon / QtFirebase

An effort to bring Google's Firebase C++ API to Qt + QML
MIT License
284 stars 83 forks source link

error in compilation of latest Firebase on iOS #110

Closed rmallah closed 5 years ago

rmallah commented 5 years ago

Hi While compiling with latest firebase_cpp and firebase iOS SDK

we get below compilation error.

QtFirebase/src/ios/Firebase/AdMob/GoogleMobileAds.framework/Headers/RTBMediation/GADRTBAdapter.h:14: error: expected ')' typedef void (^GADRTBSignalCompletionHandler)(NSString *_Nullable signals,

code in context is:


#import <GoogleMobileAds/Mediation/GADMediationAdapter.h>
#import <GoogleMobileAds/RTBMediation/GADRTBRequestParameters.h>

/// Completion handler for signal generation. Returns either signals or an error object.
typedef void (^GADRTBSignalCompletionHandler)(NSString *_Nullable signals,
                                              NSError *_Nullable error);

/// Adapter that provides signals to the Google Mobile Ads SDK to be included in an OpenRTB auction.
@protocol GADRTBAdapter <GADMediationAdapter>

XCode version is: 10.2.1

                                                              ^
rmallah commented 5 years ago

downgrading the Firebase iOS library to 5.16.0 is one of the solution to get past this issue.

larpon commented 5 years ago

I'm currently unable to test or verify this as XCode refuses to update on my system

larpon commented 5 years ago

Alright. I finally got it to work.

While I can't say if this is either a Google/Firebase or Qt bug you can monkey patch: <path/to/QtFirebase>/src/ios/Firebase/AdMob/GoogleMobileAds.framework/Headers/RTBMediation/GADRTBAdapter.h

By changing:

typedef void (^GADRTBSignalCompletionHandler)(NSString *_Nullable signals,
                                              NSError *_Nullable error);

to

typedef void (^GADRTBSignalCompletionHandler)(NSString *_Nullable signalss, NSError *_Nullable error);

(or similar - note the signalss)

I can't say if this will break something in some specialcase so use at your own risk. All I've tested is that the code compiles and the QtFirebaseExample app works as expected.

I'm worried it might be something clashing with Qt's signals - maybe a keyword or macro of the same name :(

That will probably be hard to get fixed if it is