Programming

Cocoapod를 사용할 때 Xcode 경고 무시

procodes 2020. 2. 23. 12:07
반응형

Cocoapod를 사용할 때 Xcode 경고 무시


최신 Xcode 업데이트 후에 많은 경고가있는 많은 타사 라이브러리를 사용합니다. (예 : Facebook SDK pod) 이제이 모든 경고가 내 경고 또는 오류를보고 싶은 곳에 Xcode에 표시됩니다.

이러한 오류를 무시할 수있는 방법이 있습니까? 모든 "포드 설치"후에 변경 사항이 삭제되므로이를 수정하면 도움이되지 않습니다.


Podfile에 추가하십시오 :

platform :ios

# ignore all warnings from all pods
inhibit_all_warnings!

# ignore warnings from a specific pod
pod 'FBSDKCoreKit', :inhibit_warnings => true

그런 다음 다음을 실행하십시오. pod install


프로젝트 작업 공간에서 PodBundle의 xcode 빌드 설정에서 "inhibit_all_warnings"를 검색하여 값을 "YES"로 설정하면 포드 파일 경고가 모두 숨겨집니다.

작업 공간으로 작업하면 모든 프로젝트도 숨겨집니다.


이 다른 답변 은 빌드 단계에서 경고를 제거 하지만 단계를 완전히 수정하지는 않습니다 Analyze(CI 빌드에 여전히 문제가 있음).

나를 위해 일한 것은 (허용 된 답변 외에도) 다음과 같습니다.

  • Pods프로젝트 네비게이터에서 프로젝트를 클릭하십시오
  • 실제 Pod-목표를 선택 하고 클릭하십시오Build Settings
  • 문구로 필터링 compiler flags
  • Other C Flags으로 새로운 것을 추가하십시오 -w -Xanalyzer -analyzer-disable-checker -Xanalyzer core(또는 사용하지 않아야 할 분석기)- 이 답변 은 시도 할 플래그의 전체 목록을 제공합니다.

    그러나 clangXcode 6.3.1 의 버전은 포함 insecureAPI되어 있지 않으므로 해당 목록에서 제거 할 수 있습니다. "현재"전체 목록은-w -Xanalyzer -analyzer-disable-checker -Xanalyzer alpha -Xanalyzer -analyzer-disable-checker -Xanalyzer core -Xanalyzer -analyzer-disable-checker -Xanalyzer cplusplus -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode -Xanalyzer -analyzer-disable-checker -Xanalyzer debug -Xanalyzer -analyzer-disable-checker -Xanalyzer llvm -Xanalyzer -analyzer-disable-checker -Xanalyzer osx -Xanalyzer -analyzer-disable-checker -Xanalyzer security -Xanalyzer -analyzer-disable-checker -Xanalyzer unix

Pods프로젝트 또는 Pods대상 에서이를 설정하면 작동하지 않습니다 . 왜 그런지 잘 모르겠지만 실제 Pod-목표 마다 설정해야합니다 .

파일별로 컴파일러 플래그 -w -Xanalyzer -analyzer-disable-checker -Xanalyzer core등을 설정할 수도 있습니다 .

나는 또한 몇 가지 다른 방법을 시도했다 (위에 추가하거나 필요하지 않을 수도 있음). 그들은 Pods프로젝트 자체 에서 수행되었습니다 .


[1]

  • 문구로 필터링 analyzer
  • Analyze During 'Build'로 설정되어 있는지 확인하십시오 NO.
  • 모든 설정 변경 NO(포함를 Improper Memory Management)

[2]

  • 문구로 필터링 warnings
  • 변경 inhibit all warningsYES

어떤 이유로 든 Analyze계획 단계를 비활성화해도 작동 하지 않는 것 같습니다.

Product > Scheme > Manage Schemes창으로 이동 Pod-*하여 목록 에서 각각 을 클릭하고 Edit버튼을 클릭하십시오 . Build왼쪽 목록을 클릭 한 다음 오른쪽에서 대상의 선택 취소Analyze 하십시오 Pod.

스키마의 빌드 설정에서 "암시 적 종속성 찾기"와 관련이있을 것으로 예상되지만 포드가 분석되지 않도록 완전히 비활성화 할 수없는 이유에 대해서는 여전히 혼란스러워합니다. 그래도 선택하지 않으면 앱이 포드에 연결하기 위해 다른 일이 발생 해야하는 것처럼 보입니다.


단계 : 1 아래 스크립트를 Podfile에 넣으십시오.

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = "YES"
        end
    end
end

2 단계 pod install.

참고 URL : https://stackoverflow.com/questions/13208202/ignore-xcode-warnings-when-using-cocoapods



반응형