【React Native】エラー対応
■エラー
"IPA processing failed” in Xcode 12.4 with MAC M1
M1 Macでアーカイブでエラー
(対応)
■アプリケーション > Xcode.app
情報を見る
「Rosetta を使用して開く」をチェック
■アプリケーション > ユーティリティ > ターミナル.app
情報を見る
「Rosetta を使用して開く」をチェック
(参考)
■エラー
console.error "React Native version mismatch.
JavaScript version: 0.61.5
Natvie version: 0.63.3
[対応]
watchman watch-del-all && react-native start —reset-cache
■エラー
error listen EADDRINUSE: address already in use :::8081
ポートの衝突
[対応]
一度使用しているポート8081を消去してから、再度立ち上げる
//ポートのPIDを特定する
lsof -i :8081
//消去
kill -9 PID
(参考)
https://qiita.com/shumatsukishu/items/68755725a9370c119c8c
■エラー
error Could not find the following native modules: react-native-camera. Did you forget to run "pod install" ?
(対応)
cd ios
pod install --repo-update
(参考)
pod repo update を実行することで、任意のタイミングでキャッシュを更新することが出来る。
リリース済みのバージョンであるにもかかわらず、Podfile 上で指定されたバージョンのライブラリが見つからない、もしくは最新のバージョンが入らない(Podfile 上でバージョンの指定がない場合には、そのライブラリの最新バージョンが取得される)場合には、これによって対処できるかもしれない。
https://qiita.com/msh5/items/c35717b27975c9e48d15
■エラー
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-camera (to unlink run: "react-native unlink react-native-camera")
(対応)
react-native unlink react-native-camera
■エラー
ExceptionsManager.js:179 Error:
`createStackNavigator()` has been moved to `react-navigation-stack`.
See https://reactnavigation.org/docs/stack-navigator.html for more details.
(対応)
https://www.366service.com/jp/qa/a78df5ad655f7b59b58259d70bd13c9d
以下のコマンドで追加
react-native install react-navigation-stack save
■エラー
ExceptionsManager.js:179 Error:
undefined Unable to resolve module `@react-native-community/masked-view` from `node_modules/react-navigation-stack/lib/module/vendor/views/MaskedViewNative.js`: @react-native-community/masked-view could not be found within the project.
(対応)
yarn add @react-native-community/masked-view
もしくは
npm install --save @react-native-community/masked-view
(参考)
https://qiita.com/kum44/items/982086c79a09b14e7afc
キャッシュのクリア
lsof -n -P -i :8081 -t | xargs kill
rm -rf ios/build
rm -rf android/app/build
rm -rf node_modules
yarn
(起動)
yarn react-native run-ios
■エラー
Unable to resolve module react-native install react-natvie-safe-area-context save
(対応)
npm i react-native-safe-area-context
(参考)
https://www.npmjs.com/package/react-native-safe-area-context
■エラー
Unable to resolve module react-native-screens
(対応)
npm install --save react-navigation react-native-gesture-handler react-native-reanimated react-native-screens
(参考)
https://dev-yakuza.posstree.com/react-native/react-navigation/
■エラー
ExceptionsManager.js:179 Error:
`createBottomTabNavigator()` has been moved to `react-navigation-tabs`.
See https://reactnavigation.org/docs/bottom-tab-navigator.html for more details.
(対応)
npm install --save react-navigation-tabs
■エラー
Could not find store in the context of Connect(Home) Either wrap the root component in a Provider
(対応)
おそらく、、、書き方が変わったのかも
React Redux 7.1.0からフック(Hook)が備わりました
昔
import { connect } from 'react-redux'
今
import { useSelector, useDispatch } from 'react-redux';
(参考)
http://www.fumiononaka.com/Business/html5/FN2004004.html
■エラー
シミュレータ起動時に
Print: Entry, “:CFBundleIdentifier”, Does Not Exist
[対応]
x-codeで起動すると解決したりする
https://www.haneca.net/react-native-cfbundleidentifier-error/