ios에 admob, firebase을 pod로 추가하기.

2020. 1. 6. 22:40낙서

xcode에 admob, firebase를 설치하기 위해서 필요한 정보를 기록한다. ( CocoPods는 이미 설치되어야 한다.)

 

1. pod 로 설치

    xcode프로젝트 Base디렉토리에서 pod init를 실행하면, Podfile이 만들어 진다.

    Podfile파일에 아래 2라인을 추가한다.

    pod 'Google-Mobile-Ads-SDK'
    pod 'Firebase/Analytics'
    pod 'Firebase/AdMob'

    $pod install --repo-update

 

2. pod 설치 중 메시지 대응

   아래의 메시지를 만나게 되면 xcode에서 Build Settings에서 'Other Linker Flags' 검색하여

   2개의 옵션을 추가한다.

    -ObjC

    $(inherited)  

    Podfile에서 2번째 라인의 '#'을 제거해 준다.

    #platform :ios, '9.0'  ==> platform :ios, '9.0'

 

3. xcode 실행

  *.xcodeproj파일로 열면 'firebframework not found firebasecore' 메시지 등으로 컴파일이 되지 않는다.

  *.xcworkspace파일로 열어서 실행을 해야한다. 

   

4. pod install중 메시지

Pod installation complete! There are 2 dependencies from the Podfile and 12 total pods installed.

[!] Automatically assigning platform `iOS` with version `13.2` on target `*******` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

[!] The `******* [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 `******* [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.

 

끝.