5월, 2022의 게시물 표시

React Native Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?

 리액트 네이티브 드로어 내비게이터를 사용중 아래와 같은 에러가 발생했습니다. 드로어 내비게이터가 의존적인 react-native-reanimated  관련 발생한 에러네요. Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin? Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. babel.config.js 파일이 처음에 아래와 같이 되어 있는데 plugins 부분을 추가 해줍니다. module . exports = { presets : [ 'module:metro-react-native-babel-preset' ], }; 아래와 같이 추가 후 npm start -- --reset-cache 를 실행해 번들링을 다시 해주면 잘 되네요. 혹시 plugins 부분이 아래와 같이 단순하지 않으신 분들은 위 링크를 참고해서 배열의 제일 마지막 부분에 내용을 추가해주면 됩니다. module . exports = { presets : [ 'module:metro-react-native-babel-preset' ], plugins : [ 'react-native-reanimated/plugin' ], };

pod install 후 xcrun: error: SDK "iphoneos" cannot be located

이미지
리액트 네이티브 프로젝트를 iOS 시뮬레이터에서 실행하기전에 pod install를 했더니 아래와 같이 에러가 발생하네요. [!] /bin/bash -c  set -e #!/bin/bash # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. set -e PLATFORM_NAME="${PLATFORM_NAME:-iphoneos}" CURRENT_ARCH="${CURRENT_ARCH}" if [ -z "$CURRENT_ARCH" ] || [ "$CURRENT_ARCH" == "undefined_arch" ]; then     # Xcode 10 beta sets CURRENT_ARCH to "undefined_arch", this leads to incorrect linker arg.     # it's better to rely on platform name as fallback because architecture differs between simulator and device     if [[ "$PLATFORM_NAME" == *"simulator"* ]]; then         CURRENT_ARCH="x86_64"     else         CURRENT_ARCH="arm64"     fi fi if [ "$CURRENT_ARCH" == "arm64" ]; then     cat <<\EOF >>fix_glog_0.3.5_apple_silico