ReactNative Xcode 16. RCTAppDelegate.h not find
안녕하세요? 에러로 고통받다가 커리어리에 남겨봅니다.
ReactNative 프로젝트로 테스트플라이트 배포상태에서 3주가 지나 지난주 Xcode 16으로 업데이트 되었는데요. 그 뒤 ios 버전, 라이브러리 버전 문제는 해결했는데.
Xcode 에서 build /ios/프로젝트명/AppDelegate.h 파일에서
#import <RCTAppDelegate.h> 파일을 찾을 수 없다고 나옵니다.
사양
1. M2, Sequoia
2. react-native : 0.74.3
3. Xcode 16.1
문제 해결을 위해 시도한 방법 입니다.
1. #import <React/RCTAppDelegate.h> 바꿔봄
2. #import "AppDelegate.h" 바꿔봄
3. node_module/react-native/React/Base/에서 헤더파일 찾아봄 -> 없음
4. node_module/react-native/ReactCommon/에서 헤더파일 찾아봄 -> 없음
5. 대체할 수 있는 방법 찾아봄 GPT에서 제안한 방법으로 수정 -> 결과 : 파일 찾을 수 없음
#import <UIKit/UIKit.h>
#import <React/RCTBridgeDelegate.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;
@end
6. Xcode에서 경로를 추가해봄 -> 결과 : 파일 찾을 수 없음
6-1. Xcode > BuildSetting > search header 에 경로를 추가했습니다.
"$(SRCROOT)/../node_modules/react-native/React",
"$(SRCROOT)/../node_modules/react-native/ReactCommon",
"$(SRCROOT)/../node_modules/react-native/ReactCommon/cxxreact",
"$(SRCROOT)/../node_modules/react-native/Libraries",
6-2. Xcode > BuildSetting > Frame search header에 경로를 추가했습니다.
"$(inherited)",
"$(SRCROOT)/../node_modules/react-native/React",
"$(SRCROOT)/../node_modules/react-native/ReactCommon",
7. pod 재설치, react-native 재설치, 캐시 삭제 및 라이브러리 업데이트 등..
pod.lock, Podfile, node_module, build 파일, DerivedData 폴더 삭제 후 전부 재설치.
pod install --repo-update
헤르메스 사용 설정 및 use_frameworks! :linkage => :static 설정 확인.
8. react-native 최신버전(0.76.3)으로 재설치
참고 사이트 및 GPT, Monica 질의응답 공유 링크
https://github.com/facebook/react-native/issues/36611
https://stackoverflow.com/questions/75822104/rctappdelegate-h-file-not-found
https://chatgpt.com/share/674e6dcf-89f8-800f-b0e6-4fa2fe58419b
https://monica.im/share/chat?shareId=CQ18cvvPvsMc0r3U
** 유의미한 정보를 주신분께 감사의 마음으로 많지는 않지만 스타벅스 커피쿠폰을 드립니다
살려주세요..
#reactnative-run-ios
#xcode
#appdelegate.h