[RN error - iOS] error: The linked library 'libPods-.a' is missing one or more architectures required by this target: arm64.

stand up_ lee·2022년 10월 6일
0

RN - build error

목록 보기
7/9

Build Error

error: The linked library 'libPods-.a' is missing one or more architectures required by this target: arm64.

  1. xcode command line을 재설치 -> 해결 안됨..
  1. xcworkspace 를 xcode에서 열어서 실행시키면 되는데, 프로젝트 파일에서 npx react-native run-ios 했을 때는 계속 같은 에러가 났다.
error: The linked library 'libPods-yard.a' is missing one or more architectures required by this target: arm64.

https://jusung.github.io/Xcode12-Build-Error/

위 블로그에 자세히 설명이 되어 있었다.
결론적으로 아이폰 시뮬레이터는 맥 CPU 아키텍쳐를 따르는데, 내가 실행하고자 하는 시뮬레이터의 실제 아키텍쳐와 맥의 아키텍쳐가 달라 호환성 문제가 생겨서 실행이 안되는 것이었다.

  • Project 파일과 Pods의 Build Settings > Architectures > iOS Simulator SDK 에 각각 arm64를 추가해줬다.

  • ios 폴더의 Podfile 에 들어가서 build_setting 부분을 추가했다.
  post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" <- 여기
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' 		<- 여기
    end
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

0개의 댓글