이 방법으로 꼭 해결된다기보다 해볼 수 있는 것들
1. Podfile이 잘못되었는지 확인
: 잘못된 프로젝트 타겟 네임 수정하거나 주석처리
#target 'react_app-tvOS' do
# Pods for react_app-tvOS
# target 'react_app-tvOSTests' do
# inherit! :search_paths
### Pods for testing
#end
2. 리액트 네이티브 CLI 전역 제거
npm uninstall -g react-native-cli
3. 특정 환경변수 제거
unset NODE_EXTRA_CA_CERTS
4. cocopods 파일 제거
rm -rf ~/.cocoapods/repos/trunk/\n
5. m1 mac에서 pod install하면 ffi 에러날 시
(...) tried: '/opt/homebrew/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /opt/homebrew/lib/ruby/gems/3.1.0/gems/ffi-1.15.5/lib/ffi_c.bundle (LoadError)
( ... )
- 기존 패키지 제거하고 재설치
brew uninstall --ignore-dependencies ruby
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-downloader
6. 저장소 업데이트하고 다시 install
pod repo update
pod install
7. Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false
target 'reactApp' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'reactAppTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
8. requireNativeComponent: "RNCWebView" was not found in the UIManager 에러 날 시
-> 리액티 네이티브, 웹뷰 패키지 설치 확인 후 npm i
"react": "18.0.0",
"react-native": "0.69.0",
"react-native-webview": "11.22.3"
-> pod install 명령어를 vs code 터미널이 아닌 iTerm을 사용해 입력
9. target error 시
[!] CocoaPods could not find compatible versions for pod "React-RCTSettings":
In Podfile:
React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
Specs satisfying the `React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)` dependency were found, but they required a higher minimum deployment target.
위와 같은 오류가 나면 Podfile의 타겟을 올린다.
platform :ios, '12.4'
이런저런 과정들을 수행했는데도 제대로 pod install 이나 빌드, 앱 실행이 잘 안된다면 package, package-lock.json 의존성을 잘 살펴보자. 필요한 의존성 패키지가 설치되지 않아서일 가능성이 있다.
(...)
"node_modules/@react-navigation/stack": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/@react-navigation/stack/-/stack-6.2.1.tgz",
"integrity": "sha512-JI7boxtPAMCBXi4VJHVEq61jLVHFW5f3npvbndS+XfOsv7Gf0f91HOVJ28DS5c2Fn4+CO4AByjUozzlN296X+A==",
"dependencies": {
"@react-navigation/elements": "^1.3.3",
"color": "^3.1.3",
"warn-once": "^0.1.0"
},
"peerDependencies": {
"@react-navigation/native": "^6.0.0",
"react": "*",
"react-native": "*",
"react-native-gesture-handler": ">= 1.0.0",
"react-native-safe-area-context": ">= 3.0.0",
"react-native-screens": ">= 3.0.0"
}
(...)
'Mobile App Develop > iOS개발' 카테고리의 다른 글
iOS앱 업데이트 심사 (0) | 2022.07.06 |
---|---|
This operation can fail if the version of the OS on the device is incompatible with the installed version of Xcode. 오류 뜰 시 (0) | 2022.07.05 |
[Xcode] Ipad - UserAgent가 MacOS X로 고정될때 해결법 (0) | 2022.04.06 |
[Xcode] iOS 앱 스키마 등록 (0) | 2022.02.08 |
[Xcode] iOS 앱 기본 언어(Localization) 설정 (0) | 2022.02.04 |