質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

解決済

1回答

981閲覧

アプリ実行時にThread 1: signal SIGABRTが出てします

Jonny_dayo

総合スコア48

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2019/08/16 16:21

編集2019/08/16 16:40

前提・実現したいこと

GoogleAdMobを利用し、作ったアプリ内にバナー広告をつけて実行しようとしたところ、表題のエラーが出てしまいました。助けてください。。

発生している問題・エラーメッセージ

Thread 1: signal SIGABRT

該当のソースコード

Swift

1//Appdelegate.swiftのコード 2import UIKit 3import GoogleMobileAds 4 5@UIApplicationMain 6class AppDelegate: UIResponder, UIApplicationDelegate, GADBannerViewDelegate { 7 8 var window: UIWindow? 9 10 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 11 12 GADMobileAds.sharedInstance().start() 13 14 return true 15 } 16 17 func applicationWillResignActive(_ application: UIApplication) { 18 } 19 func applicationDidEnterBackground(_ application: UIApplication) { 20 } 21 func applicationWillEnterForeground(_ application: UIApplication) { 22 } 23 func applicationDidBecomeActive(_ application: UIApplication) { 24 } 25 func applicationWillTerminate(_ application: UIApplication) { 26 } 27} 28 29//ViewController.swiftのコード 30import UIKit 31import GoogleMobileAds 32 33class ViewController: UIViewController,UITextFieldDelegate,GADBannerViewDelegate { 34 35 let TestID = "ca-app-pub-3940256099942544/2934735716" 36 let DEVICE_ID = "" 37 let simulatorTest = true 38 39 @IBOutlet var meisi: UITextField! 40 41 @IBOutlet weak var meisi1: UITextField! 42 43 @IBOutlet var keiyousi1: UITextField! 44 45 override func viewDidLoad() { 46 super.viewDidLoad() 47 48 meisi.delegate = self 49 meisi1.delegate = self 50 keiyousi1.delegate = self 51 52 var admobView = GADBannerView() 53 admobView = GADBannerView(adSize: kGADAdSizeBanner) 54 admobView.frame.origin = CGPoint(x: 0, y: self.view.frame.size.height - admobView.frame.height) 55 56 admobView.frame.size = CGSize(width: self.view.frame.width, height: admobView.frame.height) 57 58 admobView.adUnitID = TestID 59 admobView.delegate = self 60 admobView.rootViewController = self 61 62 let admobRequest = GADRequest() 63 if simulatorTest == true{ 64 admobRequest.testDevices = [kGADSimulatorID] 65 66 }else{ 67 68 admobRequest.testDevices = [DEVICE_ID] 69 70 } 71 admobView.load(admobRequest) 72 self.view.addSubview(admobView) 73 } 74 func textFieldShouldReturn(_ textField: UITextField) -> Bool { 75 76 textField.resignFirstResponder() 77 return true 78 79 } 80 81 override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { 82 83 meisi.resignFirstResponder() 84 meisi1.resignFirstResponder() 85 keiyousi1.resignFirstResponder() 86 87 } 88 89 @IBAction func button(_ sender: Any) { 90 let items = ["いっぱい入れてるため省略"] 91 let r = Int(arc4random()) % items.count 92 meisi.text = items[r] 93 94 } 95 96 @IBAction func button1(_ sender: Any) { 97 let items = ["いっぱい入れてるため省略"] 98 let r = Int(arc4random()) % items.count 99 meisi1.text = items[r] 100 101 } 102 103 @IBAction func button2(_ sender: Any) { 104 let items = ["いっぱい入れてるため省略"] 105 let k = Int(arc4random()) % items.count 106 keiyousi1.text = items[k] 107 108 } 109 110 override func didReceiveMemoryWarning(){ 111 super.didReceiveMemoryWarning() 112 113 } 114} 115

試したこと

・コネクトが外れてないか確認→外れてない
・Moduleとclassの確認→付いている
・AppDelegate.swiftのInfo.plistにはGADApplicationIdentifierキーを追加し、そこにAdMobAppIDを入れた。

補足情報(FW/ツールのバージョンなど)

Xcode : Version 10.3 (10G8)
Swift : Apple Swift version 5.0.1

デバッグエリアのログ↓

2019-08-17 01:31:56.113151+0900 idea[62244:3150194] [NetworkInfo] Descriptors query returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.core2019-08-17 01:31:56.801042+0900 idea[62244:3148999] *** Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without AppMeasurement. Google AdMob publishers, follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to include the AppMeasurement framework and set the -ObjC linker flag. Google Ad Manager publishers, follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

デバッグエリアの英語を翻訳機に突っ込んで見ればいいのではないでしょうか?

Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without AppMeasurement. Google AdMob publishers, follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to include the AppMeasurement framework and set the -ObjC linker flag. Google Ad Manager publishers, follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'

ハイライトしたとこだけでも、
「アプリを終了した」、「理由」、「Google Mobile Ads SDKはアプリの設定なしに初期化されました」、「以下の指示に従え: URL」と書いてあります。その後にもゴニョゴニョ書いてありますので、よく見てみて下さい。

質問するのも大事ですが、よくXcodeに書かれていることを読むことも大事ですよ。

投稿2019/08/16 18:15

hameji

総合スコア1380

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Jonny_dayo

2019/08/17 01:56

仰る通りですね!! ここ使わなかったらデバッグエリアのことも分からなかったのでとても助かりました! ありがとうございました????
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問