質問編集履歴

2

修正

2021/06/20 11:49

投稿

tantan1
tantan1

スコア31

test CHANGED
File without changes
test CHANGED
@@ -10,122 +10,68 @@
10
10
 
11
11
  Launching lib/main.dart on iPhone 11 in debug mode...
12
12
 
13
- Running pod install...
13
+ Running Xcode build...
14
+
14
-
15
+ Xcode build done. 11.3s
16
+
17
+ Failed to build iOS app
18
+
15
- CocoaPods' output:
19
+ Error output from Xcode build:
16
20
 
17
21
 
18
22
 
19
- Preparing
20
-
21
-
22
-
23
- Analyzing dependencies
24
-
25
-
26
-
27
- Inspecting targets to integrate
28
-
29
- Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
30
-
31
-
32
-
33
- Finding Podfile changes
34
-
35
- - Flutter
36
-
37
- - google_mobile_ads
38
-
39
-
40
-
41
- Fetching external sources
42
-
43
- -> Fetching podspec for `Flutter` from `Flutter`
44
-
45
- -> Fetching podspec for `google_mobile_ads` from `.symlinks/plugins/google_mobile_ads/ios`
46
-
47
-
48
-
49
- Resolving dependencies of `Podfile`
50
-
51
- CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
52
-
53
- CDN: trunk Relative path: all_pods_versions_5_9_a.txt exists! Returning local because checking is only perfomed in repo update
54
-
55
- CDN: trunk Relative path: Specs/5/9/a/Google-Mobile-Ads-SDK/8.0.0/Google-Mobile-Ads-SDK.podspec.json exists! Returning local because checking is only perfomed in repo update
56
-
57
- [!] CocoaPods could not find compatible versions for pod "Google-Mobile-Ads-SDK":
58
-
59
- In snapshot (Podfile.lock):
60
-
61
- Google-Mobile-Ads-SDK (= 7.69.0)
62
-
63
-
64
-
65
- In Podfile:
66
-
67
- google_mobile_ads (from `.symlinks/plugins/google_mobile_ads/ios`) was resolved to 0.0.1, which depends on
68
-
69
- Google-Mobile-Ads-SDK (= 8.5.0)
70
-
71
-
72
-
73
- Specs satisfying the `Google-Mobile-Ads-SDK (= 7.69.0), Google-Mobile-Ads-SDK (= 8.5.0)` dependency were found, but they required a higher minimum deployment target.
74
-
75
-
76
-
77
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
78
-
79
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
80
-
81
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
82
-
83
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
84
-
85
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:257:in `process_topmost_state'
86
-
87
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
88
-
89
- /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
90
-
91
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
92
-
93
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
94
-
95
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
96
-
97
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
98
-
99
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
100
-
101
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
102
-
103
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
104
-
105
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
106
-
107
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
108
-
109
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
110
-
111
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
112
-
113
- /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
114
-
115
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
116
-
117
- /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
118
-
119
- /usr/local/bin/pod:23:in `load'
120
-
121
- /usr/local/bin/pod:23:in `<main>'
122
-
123
-
124
-
125
- Error running pod install
23
+ objc[42521]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x20c6bec10) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x122d802b8). One of the two will be used. Which one is undefined.
24
+
25
+ objc[42521]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x20c6bec60) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x122d80308). One of the two will be used. Which one is undefined.
26
+
27
+ ** BUILD FAILED **
28
+
29
+
30
+
31
+
32
+
33
+ Xcode's output:
34
+
35
+
36
+
37
+ Error: Cannot run with sound null safety, because the following dependencies
38
+
39
+ don't support null safety:
40
+
41
+
42
+
43
+ - package:google_mobile_ads
44
+
45
+
46
+
47
+ For solutions, see https://dart.dev/go/unsound-null-safety
48
+
49
+
50
+
51
+ Command PhaseScriptExecution failed with a nonzero exit code
52
+
53
+ note: Using new build system
54
+
55
+ note: Building targets in parallel
56
+
57
+ note: Planning build
58
+
59
+ note: Analyzing workspace
60
+
61
+ note: Constructing build description
62
+
63
+ note: Build preparation complete
64
+
65
+ /Users/flutter/adtest/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from project 'Pods')
66
+
67
+
68
+
69
+ Could not build the application for the simulator.
126
70
 
127
71
  Error launching application on iPhone 11.
128
72
 
73
+
74
+
129
75
  ```
130
76
 
131
77
 
@@ -160,10 +106,6 @@
160
106
 
161
107
  import 'dart:io';
162
108
 
163
- import 'package:flutter/foundation.dart';
164
-
165
-
166
-
167
109
  void main() {
168
110
 
169
111
  //以下の二行を追加
@@ -214,8 +156,6 @@
214
156
 
215
157
 
216
158
 
217
-
218
-
219
159
  final String title;
220
160
 
221
161
 
@@ -230,8 +170,6 @@
230
170
 
231
171
  class _MyHomePageState extends State<MyHomePage> {
232
172
 
233
-
234
-
235
173
  // This widget is the root of your application.
236
174
 
237
175
  final BannerAd myBanner = BannerAd(
@@ -246,106 +184,88 @@
246
184
 
247
185
  );
248
186
 
249
-
187
+ @override
188
+
250
-
189
+ Widget build(BuildContext context) {
190
+
251
- int _counter = 0;
191
+ myBanner.load();
192
+
193
+
194
+
252
-
195
+ final AdWidget adWidget = AdWidget(ad: myBanner);
196
+
197
+
198
+
253
-
199
+ final Container adContainer = Container(
254
-
200
+
255
- void _incrementCounter() {
201
+ alignment: Alignment.center,
256
-
202
+
257
- setState(() {
203
+ child: adWidget,
258
-
204
+
259
- _counter++;
205
+ width: myBanner.size.width.toDouble(),
206
+
260
-
207
+ height: myBanner.size.height.toDouble(),
208
+
261
- });
209
+ );
210
+
211
+ return Scaffold(
212
+
213
+ appBar: AppBar(
214
+
215
+ title: Text(widget.title),
216
+
217
+ ),
218
+
219
+ body: Center(
220
+
221
+
222
+
223
+ child: Column(
224
+
225
+
226
+
227
+ mainAxisAlignment: MainAxisAlignment.center,
228
+
229
+ children: <Widget>[
230
+
231
+ adContainer,
232
+
233
+ ],
234
+
235
+ ),
236
+
237
+ ),
238
+
239
+ // This trailing comma makes auto-formatting nicer for build methods.
240
+
241
+ );
262
242
 
263
243
  }
264
244
 
265
-
266
-
267
- @override
245
+ }
268
-
269
- Widget build(BuildContext context) {
246
+
270
-
271
- myBanner.load();
247
+
272
-
248
+
273
- final AdWidget adWidget = AdWidget(ad: myBanner);
249
+ //プラットホームごとのテスト広告IDを取得するメソッドをどこかに配置してください。
274
-
275
- final Container adContainer = Container(
250
+
276
-
277
- alignment: Alignment.center,
251
+ String getTestAdBannerUnitId(){
278
-
279
- child: adWidget,
252
+
280
-
281
- width: myBanner.size.width.toDouble(),
282
-
283
- height: myBanner.size.height.toDouble(),
253
+ String testBannerUnitId = "";
284
-
285
- );
254
+
286
-
287
- return Scaffold(
255
+ if(Platform.isAndroid) {
288
-
256
+
289
- appBar: AppBar(
257
+ // Android のとき
258
+
290
-
259
+ testBannerUnitId = "ca-app-pub-3940256099942544/6300978111";
260
+
291
- title: Text(widget.title),
261
+ } else if(Platform.isIOS) {
292
-
293
- ),
262
+
294
-
295
- body: Center(
296
-
297
- child: Column(
298
-
299
- mainAxisAlignment: MainAxisAlignment.center,
300
-
301
- children: <Widget>[
302
-
303
- adContainer
304
-
305
- ],
306
-
307
- ),
308
-
309
- ),
310
-
311
- floatingActionButton: FloatingActionButton(
312
-
313
- onPressed: _incrementCounter,
314
-
315
- tooltip: 'Increment',
263
+ // iOSのとき
316
-
317
- child: Icon(Icons.add),
264
+
318
-
319
- ), // This trailing comma makes auto-formatting nicer for build methods.
265
+ testBannerUnitId = "ca-app-pub-3940256099942544/2934735716";
320
-
321
- );
322
266
 
323
267
  }
324
268
 
325
- }
326
-
327
-
328
-
329
- //プラットホームごとのテスト広告IDを取得するメソッドをどこかに配置してください。
330
-
331
- String getTestAdBannerUnitId(){
332
-
333
- String testBannerUnitId = "";
334
-
335
- if(Platform.isAndroid) {
336
-
337
- // Android のとき
338
-
339
- testBannerUnitId = "ca-app-pub-XXX/XXX";
340
-
341
- } else if(Platform.isIOS) {
342
-
343
- // iOSのとき
344
-
345
- testBannerUnitId = "ca-app-pub-XXX/XXX";
346
-
347
- }
348
-
349
269
  return testBannerUnitId;
350
270
 
351
271
  }
@@ -354,11 +274,107 @@
354
274
 
355
275
 
356
276
 
357
-
277
+ Podfile
278
+
358
-
279
+ ※2行目でiOSのバージョンを11に指定
280
+
359
-
281
+ ```txt
282
+
360
-
283
+ # Uncomment this line to define a global platform for your project
284
+
285
+ platform :ios, '11.0'
286
+
287
+
288
+
289
+ # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
290
+
291
+ ENV['COCOAPODS_DISABLE_STATS'] = 'true'
292
+
293
+
294
+
295
+ project 'Runner', {
296
+
297
+ 'Debug' => :debug,
298
+
299
+ 'Profile' => :release,
300
+
301
+ 'Release' => :release,
302
+
303
+ }
304
+
305
+
306
+
307
+ def flutter_root
308
+
309
+ generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
310
+
311
+ unless File.exist?(generated_xcode_build_settings_path)
312
+
313
+ raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
314
+
315
+ end
316
+
317
+
318
+
319
+ File.foreach(generated_xcode_build_settings_path) do |line|
320
+
321
+ matches = line.match(/FLUTTER_ROOT\=(.*)/)
322
+
323
+ return matches[1].strip if matches
324
+
325
+ end
326
+
327
+ raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
328
+
329
+ end
330
+
331
+
332
+
333
+ require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
334
+
335
+
336
+
337
+ flutter_ios_podfile_setup
338
+
339
+
340
+
341
+ target 'Runner' do
342
+
343
+ use_frameworks!
344
+
345
+ use_modular_headers!
346
+
347
+
348
+
349
+ flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
350
+
351
+ end
352
+
353
+
354
+
355
+ post_install do |installer|
356
+
357
+ installer.pods_project.targets.each do |target|
358
+
359
+ flutter_additional_ios_build_settings(target)
360
+
361
+ end
362
+
363
+ end
364
+
365
+ ```
366
+
367
+
368
+
369
+ ●Runner.xcworkspace
370
+
371
+ ※Deployment Targetを11に変更
372
+
373
+ ![イメージ説明](d035844814038f48679eeb5ab852eee1.png)
374
+
375
+
376
+
361
- pubspec.yaml
377
+ pubspec.yaml
362
378
 
363
379
  ```yaml
364
380
 

1

2021/06/20 11:49

投稿

tantan1
tantan1

スコア31

test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- 「[【2021年永久保存版】Flutter2.xGoogle Mobile Adsを使う](https://uedive.net/2021/5410/flutter2-gad/)」の記事通りにiOSアプリにgoogle_mobile_adsを使うと、以下のようにCocoaPods関連のエラーで起動しません。
1
+ FlutterでiOSアプリにgoogle_mobile_adsを使うと、以下のようにCocoaPods関連のエラーで起動しません。
2
2
 
3
3
  解決方法を教えてもらえないでしょうか。
4
4