0

我已经跟进Google Admob开始创建一个Xcode带有链接的项目,Swift3FireBase总是得到错误:
class AppDelegate: UIResponder, UIApplicationDelegate { Thread 1: signal SIGABRT }

已运行 pod update 更多时间,

我的代码:Appdelegate.swift

//I has import Firebase and GoogleMobileAds
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        FIRApp.configure()
        //GADMobileAds.configure(withApplicationID: "ca-app-pub-3940256099942544~1458002511")
        return true
    }

ViewController.swift

//I has import Firebase and GoogleMobileAds

    let kBannerAdUnitID = "ca-app-pub-3940256099942544/2934735716"

    class ViewController: UIViewController, GADBannerViewDelegate, GADInterstitialDelegate {

        @IBOutlet weak var bannerView: GADBannerView!
        override func viewDidLoad() {
            super.viewDidLoad()

            self.bannerView.adUnitID = kBannerAdUnitID
            self.bannerView.rootViewController = self
            self.bannerView.load(GADRequest())

            // Do any additional setup after loading the view, typically from a nib.
        }

        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    }
4

1 回答 1

0

抱歉,我找到了答案,我忘记将我的项目链接到 Firebase。忘记将 GoogleService-info.plist 添加到我的项目中。

于 2016-12-20T12:03:22.293 回答