npm run eject
で吐き出されたiOSのXcodeのプロジェクトを実行。
なんかのタイミングでpackage.json
が変わった
babel-preset-react-native
を4.0入れようと
npm install babel-preset-react-native
したせいか??
"babel-preset-react-native": "^4.0.1",
これがdiff
"scripts": { - "start": "react-native-scripts-ts start", - "eject": "react-native-scripts-ts eject", - "android": "react-native-scripts-ts android", - "ios": "react-native-scripts-ts ios", + "start": "react-native start", + "android": "react-native run-android", + "ios": "react-native run-ios", "test": "jest" },
これのせいかnpm eject
せずにios
フォルダができるようになった??
"eject": "react-native-scripts-ts eject",
も消されたし。
Xcodeでも似たエラー出たので
Failed to load bundle(http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false) with error:(Unable to resolve module `react-native-vector-icons/MaterialIcons` from `/Users/shinriyo/development/react_apps/kazoemon/node_modules/react-native-elements/src/buttons/Button.js`: Module `react-native-vector-icons/MaterialIcons` does not exist in the Haste module map This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following: 1. Clear watchman watches: `watchman watch-del-all`. 2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`. 3. Reset Metro Bundler cache: `rm -rf /tmp/metro-bundler-cache-*` or `npm start -- --reset-cache`. 4. Remove haste cache: `rm -rf /tmp/haste-map-react-native-packager-*`. (null))
この変なエラー
これがIssue https://github.com/facebook/react-native/issues/4968
watchman watch-del-all && rm -rf node_modules/ && yarn cache clean && yarn install && yarn start -- --reset-cache
しかし直らん。
run-ios
した時にPrint: Entry, ":CFBundleIdentifier"も出たり・・・・。
Xcode上で`ios/RNAdMobRewarded.h:9:9: Module 'GoogleMobileAds' not found出たり・・・・
react-native link
もする
Scanning folders for symlinks in /Users/shinriyo/development/react_apps/kazoemon/node_modules (14ms) rnpm-install info Platform 'ios' module react-native-admob
cd ios pod init
Podfile
も編集
target 'kazoemon' do
の他にもTVなんとかあったのは消した。
あると重複のエラー出るので。
あと、
pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/AdMob'
も追加した。
pod 'GoogleMobileAds'
は追加すると競合するっぽいのでそっちは消した。
# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'kazoemon' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks! # Pods for kazoemon pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/AdMob' target 'kazoemonTests' do inherit! :search_paths # Pods for testing end end
あと、間違えてはならないのが青い.xcodeproj
ではなく白い.xcworkspace
っぽい。
さらにreact-native-elements
っての使ってそのエラーも出てる??
https://github.com/react-native-training/react-native-elements/issues/704
見た
npm i --save react-native-vector-icons