Ответ 1
Вам нужно добавить:
$(inherited)
до OTHER_LDFLAGS
на вкладке настроек проекта
Сегодня я пытался обновить SDK GoogleAdMob до 6.12, поэтому, читая документацию, я обнаружил, что google рекомендует использовать cocoaPods для управления зависимостями. Я удалил предыдущие файлы SDK из 6.10 из моего проекта и сделал это как ниже.
Итак, я установил cocoaPods на свою машину и выполнил шаги, указанные в документах adMob
После установки модуля я получил это сообщение с терминала
Installing Google-Mobile-Ads-SDK (6.12.0)
Generating Pods project
Integrating client project
[!] From now on use `abc.xcworkspace`.
[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
[!] The `abc [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `abc [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
Мое первое сомнение Что означает это предупреждение и как это разрешить?
Во-вторых
Я открыл abc.xcworkspace, как было предложено cocoaPods, теперь я мог видеть два проекта как снимок экрана ниже
Здесь, на изображении, вы видите, что все рамки красны. Так что это проблема или ее штраф?
Наконец, мой код, который работал перед использованием cocoaPods
m_googleAdView.frame = CGRectMake(0.0, 918.0, kGADAdSizeBanner.size.width,kGADAdSizeBanner.size.height);
[m_googleAdView loadRequest:[GADRequest request]];
Мой код для добавления bannerView уже закодирован, но теперь я получаю эти ошибки
Undefined symbols for architecture armv7:
"_kGADAdSizeBanner", referenced from:
-[AllViewController viewDidLoad] in AllViewController.o
"_OBJC_CLASS_$_GADRequest", referenced from:
objc-class-ref in AllViewController.o
objc-class-ref in PageViewController.o
"_OBJC_CLASS_$_GADBannerView", referenced from:
objc-class-ref in AllViewController.o
objc-class-ref in PageViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Вам нужно добавить:
$(inherited)
до OTHER_LDFLAGS
на вкладке настроек проекта
В качестве альтернативы вы можете сделать это:
- Remove the build settings from the target.
Перейдите к своему проекту, над Другие флаги компоновщика (рисунок @Andrei выше) и нажмите delete. Он удалит ваши настройки, чтобы записать унаследованные из настроек сборки pods.
Не делайте этого, если у вас есть дополнительные флаги...
@Ranjit: для этой проблемы:
[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:
Просто добавьте эту строку
source 'https://github.com/CocoaPods/Specs.git'
В верхней части вашего podfile, как сказано...