Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

219 views
Skip to first unread message

Marcel Kretzmann

unread,
Jun 23, 2019, 6:34:35 PM6/23/19
to Google Mobile Ads SDK Developers

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



Mobile Ads SDK Forum Advisor Prod

unread,
Jun 23, 2019, 11:03:50 PM6/23/19
to kaitow...@gmail.com, google-adm...@googlegroups.com

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



ref:_00D1U1174p._5001UCZ5Qi:ref

Alexander Mishvelia

unread,
Apr 18, 2020, 11:57:27 AM4/18/20
to Google Mobile Ads SDK Developers
Hello. Did you figure it out? I've got the exact same issue as Marcel. I am also following the exact same video

Mobile Ads SDK Forum Advisor Prod

unread,
Apr 20, 2020, 12:40:06 AM4/20/20
to alexmi...@icloud.com, google-adm...@googlegroups.com

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?

Reply all
Reply to author
Forward
0 new messages