EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 448 forks source link

firebase.admob.showBanner fails with an exception on iOS after update #1248

Open MustafaCa opened 5 years ago

MustafaCa commented 5 years ago

Hi @EddyVerbruggen ,

After updating xcode to 10.2, iOS SDK to 12.2 and TNS to the latest, I started to get several warnings similar to the following:

` non-portable path to file '<protobuf/Timestamp.pbobjc.h>'; specified path differs in case from file name on disk [-Wnonportable-include-path]

import <Protobuf/Timestamp.pbobjc.h>

     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     <protobuf/Timestamp.pbobjc.h>

1 warning generated.`

Even though the app builds successfully, it fails with the following exception when firebase.admob.showBanner is called.

CONSOLE LOG file:///app/tns_modules/nativescript-plugin-firebase/admob/admob.js:56:24: 'Error in firebase.admob.showBanner: TypeError: GADRequest.request is not a function. (In \'GADRequest.request()\', \'GADRequest.request\' is undefined)'

Android version of the app works fine. Previously built iOS app also works fine.

firebase.nativescript.json has "admob" : true

BTW, I am testing it on iOS simulator.

Any suggestions?

Thanks, Mustafa.

EddyVerbruggen commented 5 years ago

Did you remove the platforms/ios folder after updating everything?

MustafaCa commented 5 years ago

Did you remove the platforms/ios folder after updating everything?

Yes, I did, and in fact I did it several times. The project always builds with the above mentioned warnings. The the call to showBanner fails with the same error.

MustafaCa commented 5 years ago

OK, I found a solution for the issue. But it is not a permanent one. In the Podfile (~/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile) I commented the line with the latest version for Firebase/Core and added a new line with an earlier version,

# pod 'Firebase/Core', '~> 5.15.0'
pod 'Firebase/Core', '~> 5.0.0'

Then

tns platform remove ios
tns build ios

The above change in the Podfile causes even more warnings, but build succeeds and showBanner works fine.

Hope it helps someone else.