[英]'React/RCTBundleURLProvider.h' file not found after updating react-native from 0.59 to 0.61.4
I recently updated my project that was using react-native 0.59 to 0.61.4.我最近将使用 react-native 0.59 的项目更新为 0.61.4。
The android build works just fine but the ios fails with error: android 构建工作正常,但 ios 失败并出现错误:
'React/RCTBundleURLProvider.h' file not found
'React/RCTBundleURLProvider.h' 文件未找到
On my project message extension.在我的项目消息扩展上。 I tried all the main fixes for this issues like:
我尝试了针对此问题的所有主要修复方法,例如:
https://github.com/facebook/react-native/issues/12077#issuecomment-302318906 https://github.com/facebook/react-native/issues/12077#issuecomment-302318906
Trying to create a React scheme, which I wasn't able to do it because React isn't shown when I try to create the scheme.尝试创建一个 React 方案,但我无法做到,因为当我尝试创建方案时没有显示 React。
My Podfile我的播客文件
platform :ios, '9.0' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'Project' do # Pods for Project pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" pod 'React', :path => '../node_modules/react-native/React' pod 'React-Core', :path => '../node_modules/react-native/' pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon" pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga' pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info' pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' pod 'RNKeychain', :path => '../node_modules/react-native-keychain' pod 'react-native-background-timer', :path => '../node_modules/react-native-background-timer' pod 'react-native-udp', :path => '../node_modules/react-native-udp' pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' pod 'react-native-fingerprint-scanner', :path => '../node_modules/react-native-fingerprint-scanner' pod 'react-native-randombytes', :path => '../node_modules/react-native-randombytes' pod 'RNSVG', :path => '../node_modules/react-native-svg'
target 'ProjectTests' do
inherit! :search_paths
# Pods for testing end
target 'ProjectMessageExtension' do
inherit! :search_paths end
use_native_modules! end
target 'Project-tvOS' do # Pods for Project-tvOS
target 'Project-tvOSTests' do
inherit! :search_paths
# Pods for testing end
end
My package.json我的 package.json
{
"name": "Project",
"version": "1.2.1",
"private": true,
"description": "",
"homepage": "",
"bugs": "",
"scripts": {
"start": "react-native start",
"build:android": "react-native run-android",
"build:ios": "react-native run-ios",
"release:android": "cd android && ./gradlew assembleRelease",
"release:android-bundle": "cd android && ./gradlew bundleRelease",
"link": "./node_modules/.bin/rn-nodeify --hack --install && node ./scripts/androidSdkFix.js",
"test": "jest --config ./jest.config.js --env=jsdom",
"test:live": "npm test -- --watch",
"test:format": "./node_modules/.bin/eslint ./",
"test:android": "cd android && ./gradlew --project-cache-dir ../.gradlecache test",
"i18n": "node ./scripts/scanner.config.js",
"test:build-e2e-release": "detox build --configuration ios.sim.release",
"test:build-e2e-debug": "detox build --configuration ios.sim.debug",
"test:e2e-clean": "detox clean-framework-cache && detox build-framework-cache",
"test:e2e-release": "node ./node_modules/cucumber/bin/cucumber-js e2e --format node_modules/cucumber-pretty --configuration ios.sim.release",
"test:e2e-debug": "node ./node_modules/cucumber/bin/cucumber-js e2e --format node_modules/cucumber-pretty --configuration=ios.sim.debug",
"prettier": "prettier 'src/**/*.js'",
"eslint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check"
},
"rnpm": {
"assets": [
"./src/assets/fonts/"
]
},
"lint-staged": {
"*.js": "eslint"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm test"
}
},
"dependencies": {
"@react-native-community/async-storage": "^1.5.0",
"@react-native-community/netinfo": "3.2.1",
"@react-navigation/core": "^3.4.2",
"@react-navigation/native": "^3.5.0",
"@remobile/react-native-qrcode-local-image": "github:yasharAyari/react-native-qrcode-local-image#support-import-from-cameraroll",
"@tradle/react-native-http": "^2.0.1",
"assert": "^1.4.1",
"axios": "^0.19.0",
"base-x": "=3.0.4",
"bignumber.js": "^7.2.1",
"bip32": "^1.0.2",
"bitcoinjs-lib": "^4.0.3",
"browserify-zlib": "^0.1.4",
"buffer": "^4.9.1",
"buffer-reverse": "^1.0.1",
"console-browserify": "^1.1.0",
"constants-browserify": "^1.0.0",
"dns.js": "^1.0.1",
"domain-browser": "^1.2.0",
"events": "^1.1.1",
"fetch-mock": "^7.2.5",
"history": "^4.7.2",
"hoist-non-react-statics": "^3.1.0",
"https-browserify": "0.0.1",
"i18next": "^13.1.2",
"lottie-react-native": "^3.2.1",
"moment": "^2.22.0",
"path-browserify": "0.0.0",
"process": "^0.11.10",
"prop-types": "^15.6.0",
"punycode": "^1.4.1",
"querystring-es3": "^0.2.1",
"react": "^16.12.0",
"react-i18next": "^9.0.2",
"react-native": "0.61.4",
"react-native-app-settings": "github:KrazyLabs/react-native-app-settings",
"react-native-background-timer": "^2.1.0-alpha.6",
"react-native-blur-overlay": "github:yasharAyari/react-native-blur-overlay",
"react-native-camera": "^2.11.1",
"react-native-camera-roll-picker": "^1.2.3",
"react-native-crypto": "^2.1.2",
"react-native-device-info": "^4.0.1",
"react-native-dropdownalert": "^3.9.2",
"react-native-fingerprint-scanner": "^3.0.2",
"react-native-gesture-handler": "^1.4.1",
"react-native-haptic-feedback": "^1.4.2",
"react-native-http": "github:tradle/react-native-http#834492d",
"react-native-interactable": "1.0.0",
"react-native-keyboard-aware-scroll-view": "^0.8.0",
"react-native-keyboard-tracking-view": "^5.5.0",
"react-native-keychain": "=3.0.0",
"react-native-level-fs": "^3.0.1",
"react-native-modal": "^6.1.0",
"react-native-modalbox": "^1.7.1",
"react-native-os": "^1.2.4",
"react-native-permissions": "^1.1.1",
"react-native-qrcode-svg": "^5.1.0",
"react-native-quick-actions": "^0.3.9",
"react-native-randombytes": "^3.5.0",
"react-native-reanimated": "^1.4.0",
"react-native-shake": "^3.3.1",
"react-native-snap-carousel": "^3.7.5",
"react-native-splash-screen": "^3.1.1",
"react-native-svg": "^8.0.11",
"react-native-svg-uri": "=1.2.3",
"react-native-swiper": "^1.6.0-rc.3",
"react-native-switch-pro": "^1.0.0-beta",
"react-native-tcp": "^3.3.0",
"react-native-udp": "^2.6.1",
"react-native-vector-icons": "^6.0.2",
"react-navigation": "^3.12.1",
"react-navigation-tabs": "^2.3.0",
"react-redux": "^5.0.7",
"react-router": "^4.2.0",
"react-test-renderer": "16.8.3",
"react-transform-hmr": "^1.0.4",
"readable-stream": "^1.0.33",
"redux": "^3.7.2",
"redux-connect-decorator": "^0.2.0",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.2.0",
"socket.io-client": "^2.1.1",
"stream-browserify": "^1.0.0",
"string_decoder": "^0.10.31",
"text-encoding": "^0.6.4",
"timers-browserify": "^1.4.2",
"tty-browserify": "0.0.0",
"url": "^0.10.3",
"url-parse": "^1.4.4",
"util": "^0.10.4",
"vm-browserify": "0.0.4"
},
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-decorators": "^7.1.0",
"@babel/plugin-transform-react-jsx-source": "^7.0.0",
"@babel/preset-env": "^7.5.5",
"@babel/preset-stage-2": "^7.0.0",
"@babel/runtime": "^7.4.5",
"@react-native-community/eslint-config": "^0.0.3",
"asyncstorage-down": "^4.0.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "=8.0.2",
"babel-jest": "^24.8.0",
"babel-plugin-rewrite-require": "^1.14.5",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"coveralls": "^3.0.2",
"cucumber": "5.1.0",
"cucumber-pretty": "1.5.0",
"detox": "14.5.0",
"eslint": "=4.18.2",
"eslint-config-airbnb": "=15.1.0",
"eslint-config-airbnb-base": "=12.1.0",
"eslint-config-prettier": "^6.1.0",
"eslint-plugin-babel": "=4.1.2",
"eslint-plugin-detox": "1.0.0",
"eslint-plugin-import": "=2.7.0",
"eslint-plugin-jest": "=21.22.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "=7.4.0",
"findit": "^2.0.0",
"glob": "^7.1.3",
"husky": "^1.0.0-rc.13",
"i18next-scanner": "^2.9.1",
"jest": "24.8.0",
"jest-cli": "^24.8.0",
"jest-junit": "^5.2.0",
"jest-runner-eslint": "^0.6.0",
"jest-transform-stub": "^1.0.0",
"lint-staged": "^8.1.3",
"metro-react-native-babel-preset": "^0.55.0",
"moxios": "^0.4.0",
"prettier": "1.18.2",
"react-test-renderer": "16.8.3",
"redux-connect-decorator": "^0.2.0",
"redux-mock-store": "^1.5.3",
"rn-nodeify": "github:tradle/rn-nodeify",
"schedule": "^0.4.0"
},
"react-native": {
"zlib": "browserify-zlib",
"console": "console-browserify",
"constants": "constants-browserify",
"crypto": "react-native-crypto",
"dns": "dns.js",
"net": "react-native-tcp",
"domain": "domain-browser",
"http": "@tradle/react-native-http",
"https": "https-browserify",
"os": "react-native-os",
"path": "path-browserify",
"querystring": "querystring-es3",
"fs": "react-native-level-fs",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"dgram": "react-native-udp",
"stream": "stream-browserify",
"timers": "timers-browserify",
"tty": "tty-browserify",
"vm": "vm-browserify",
"tls": false
},
"browser": {
"zlib": "browserify-zlib",
"console": "console-browserify",
"constants": "constants-browserify",
"crypto": "react-native-crypto",
"dns": "dns.js",
"net": "react-native-tcp",
"domain": "domain-browser",
"http": "@tradle/react-native-http",
"https": "https-browserify",
"os": "react-native-os",
"path": "path-browserify",
"querystring": "querystring-es3",
"fs": "react-native-level-fs",
"_stream_transform": "readable-stream/transform",
"_stream_readable": "readable-stream/readable",
"_stream_writable": "readable-stream/writable",
"_stream_duplex": "readable-stream/duplex",
"_stream_passthrough": "readable-stream/passthrough",
"dgram": "react-native-udp",
"stream": "stream-browserify",
"timers": "timers-browserify",
"tty": "tty-browserify",
"vm": "vm-browserify",
"tls": false
},
"detox": {
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Project.app",
"build": "xcodebuild -UseModernBuildSystem=NO -project ios/Project.xcodeproj -scheme Project -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 11"
},
"ios.sim.release": {
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/Project.app",
"build": "xcodebuild -UseModernBuildSystem=NO -project ios/Project.xcodeproj -scheme Project -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 11"
}
}
}
}
After 0.61 update React can not implemented as Scheme. 0.61 更新后 React 不能作为 Scheme 实现。 You need to install from your Podfile .
您需要从Podfile安装。
Check this out, 0.61 Changes看看这个, 0.61 变化
If you want things to work as before, just upgrade your project to 0.60.5.
如果你想让事情像以前一样工作,只需将你的项目升级到 0.60.5。
After upgrading 0.61 or up, you can try,升级0.61以上后,可以试试,
File
> Workspace Settings
click over the little grey arrow under Derived data section and select your project folder to delete it.File
> Workspace Settings
删除派生数据单击派生数据部分下的灰色小箭头和 select 您的项目文件夹以将其删除。Product
> Scheme
> Edit Scheme
> Build
you can see the ex React scheme as React(missing) . Product
> Scheme
> Edit Scheme
> Build
你可以看到前 React 方案为React(missing) 。 Just remove it and add from new React scheme from your Pods. In your Podfile React implemented as,在你的 Podfile React 实现为,
pod 'React', :path => '../node_modules/react-native/React'
You should change it like this,你应该这样改
pod 'React', :path => '../node_modules/react-native/'
After change remove Pods and Podfile.lock and re-install your Pods.更改后删除 Pods 和 Podfile.lock 并重新安装您的 Pods。
cd ios/
rm -rf Pods/ && Podfile.lock
pod install
One last thing, you can check your Podfile with this upgrade helper最后一件事,您可以使用此升级助手检查您的 Podfile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.