Hi guys I followed the instruction of this video "https://www.youtube.com/watch?v=TMj_3mQA39g"
but I get a fatal error and I have no idea what it could be. "Thread 1:
Fatal error: Unexpectedly found nil while implicitly unwrapping an
Optional value"
import UIKit
import GoogleMobileAds
class ViewController: UIViewController {
@IBOutlet weak var bannerView: GADBannerView!
override func viewDidLoad() {
super.viewDidLoad()
bannerView.adUnitID = "ca-app-pub-3940256099942544/2934735716" //Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping
//an Optional value
bannerView.rootViewController = self
bannerView.load(GADRequest())
bannerView.delegate = self
}
}
extension ViewController: GADBannerViewDelegate{
func adViewDidReceiveAd(_ bannerView: GADBannerView) {
print("received ad")
}
func adView(_ bannerView: GADBannerView, didFailToReceiveAdWithError error: GADRequestError) {
print(error)
}
Code hier eingeben...
Hi Marcel,
Thank you for writing this to us and for providing the details of the issue. I have tried your implementation on my end; however, I wasn't able to recreate the issue you've encountered. That said, could you share your project where the issue is reproducible for me to further check on my end? Please send it using Reply privately to author option.
Regards,
Mark Albios
Mobile Ads SDK Team
Hi Alexander,
Thank you for reaching out to us.
Could you try using our Banner sample app and see if you could recreate the issue on your end? If the issue is indeed reproducible, could you share the updated project file privately (via Reply privately to author option) for us to further investigate? If the issue isn't reproducible on the sample project, could you share with us your project instead?
In addition, is the issue encountered specific to an iOS device? If yes, could you also share those devices with their OS versions?