300x250
최근에 ReactNative의 iOS 빌드(아카이브) 과정에서 자꾸 못보던 문제가 발생했다. 그런데 약간 암담했던 것은, 문제점을 제대로 파악해주지 못했다는 것.
[15:24:07]: ▸ ** ARCHIVE FAILED **
[15:24:07]: ▸ The following build commands failed:
[15:24:07]: ▸ Archiving workspace onthemood with scheme onthemood
[15:24:07]: ▸ (1 failure)
[15:24:07]: Exit status: 65
[15:24:07]: Looks like fastlane ran into a build/archive error with your project
[15:24:07]: **It's hard to tell what's causing the error**, so we wrote some guides on how
[15:24:07]: to troubleshoot build and signing issues: <https://docs.fastlane.tools/codesigning/getting-started/>
[15:24:07]: Before submitting an issue on GitHub, please follow the guide above and make
[15:24:07]: sure your project is set up correctly.
[15:24:07]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[15:24:07]: the full commands printed out in yellow in the above log.
[15:24:07]: Make sure to inspect the output above, as usually you'll find more error information there
ㅤ
“It's hard to tell what's causing the error”??? 장난 똥때리나.
ㅤ
그나마 로그들을 좀 살펴보니깐 요런 메시지가 많이 나왔다.
▸ duplicate output file '' on task:
RegisterExecutionPolicyException /Users/sungmin/Documents/GitHub/
pml/tt/onthemood-epwpsdbcriyvaxeimgsbqxfeuwkx/Build/Intermediates
.noindex/ArchiveIntermediates/onthemood/IntermediateBuildFilesPat
h/UninstalledProducts/iphoneos/React-Core_privacy.bundle
(in target 'React-Core-React-Core_privacy' from project 'Pods')
ㅤ
뭔가 중복된 파일이 있어서 문제가 계속 발생한다는 내용인 듯 했다.
ㅤ
찾아보니, 뭔가 Well-known 이슈인 듯 했다. 발생 원인은 아래 두 파일에도 동일한 파일명을 가진 파일을 생성하는데, 파일명간에 충돌이 발생해서 아카이빙에 실패하는 것으로 보였다.
React-Core-React-Core\_privacy
RCT-Folly-RCT-Folly\_privacy
ㅤ
여기 깃허브의 이슈 페이지에서는 이걸 해결하려면 ios/Podfile
에 아래 커멘드를 추가하라고 나와있었다. 당장 해봤다.
if target.name == "React-Core-React-Core_privacy"
target.remove_from_project
end
if target.name == "RCT-Folly-RCT-Folly_privacy"
target.remove_from_project
end
ㅤ
근데, 둘 다 지우고 실행하니깐 이번에는 필요한 파일이 없다고 아카이빙이 실패하더라. 빌드 한 번에 10분씩 걸리는데, 왜 안되지 싶어서 빌드 여러 번 돌려보느라 단계별로 거의 30분씩 날아갔다 ^,^
ㅤ
그래서 두 target remove 명령어 중에서 React-Folly 쪽은 주석처리를 해줬다.
target 'onthemood' do
config = use_native_modules!
use_react_native!(
...
)
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
...
)
installer.pods_project.targets.each do |target|
if target.name == 'RNPermissions'
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)']
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'PERMISSION_LOCATION_WHEN_IN_USE=1'
end
end
# >>>>> 여기에 추가해줬음!
if target.name == "React-Core-React-Core_privacy"
target.remove_from_project
end
# if target.name == "RCT-Folly-RCT-Folly_privacy"
# target.remove_from_project
# end
end
end
end
이제 아카이빙이 잘 된다. 해결!
ㅤ
갑자기 발생한거라 본질적인 원인이 무엇인지는 좀 더 찾아봐야 할 것 같다. Dependency를 추가한 것도 거의 없었던 것 같은데,,,
ㅤㅤ
추가로 시도했던 것들은
- 프로젝트 캐시 초기화 ( → ClaudeCode는 로그 읽고도 이것만 주구장창 해대서 결국 직접 해결함 )
- Xcode에서 클린빌드하기
- Xcode의 Pods/target 에서 …React-Core_privacy, …RCT-Folly_privacy 이거 두 개를 delete 해버리고 빌드하기 ( → 지워도 다시 파일 생성하니깐 무의미했던 것 같음 )
320x100
'Develop > React Native' 카테고리의 다른 글
[Expo Go] 안드로이드 에뮬레이터에서 "expo go keeps stopping" 으로 Expo Go 가 자꾸 강제종료될 때 (0) | 2025.03.12 |
---|