我最近将使用反应本机0.59的项目更新为0.61.4。
android构建工作正常,但ios失败并显示错误:
找不到“ React / RCTBundleURLProvider.h”文件
在我的项目消息扩展名上。我尝试了针对此问题的所有主要修复程序,例如:
https://github.com/facebook/react-native/issues/12077#issuecomment-302318906
尝试创建一个React方案,但我无法做到,因为在尝试创建方案时未显示React。
我的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
我的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"
}
}
}
}
答案 0 :(得分:0)
0.61更新后,React无法实现为Scheme。您需要从 Podfile 安装。
检查一下,0.61 Changes
如果您希望事情像以前一样工作,只需将项目升级到 0.60.5。
升级0.61或更高版本后,您可以尝试
File
> Workspace Settings
单击移出派生数据
派生数据部分下的灰色小箭头,然后选择
项目文件夹将其删除。Product
> Scheme
> Edit Scheme
> Build
,您可以看到ex React方案为 React(missing)。只需将其删除,然后从Pod的新React方案中添加即可。在您的Podfile React中,实现为
pod 'React', :path => '../node_modules/react-native/React'
您应该像这样更改它,
pod 'React', :path => '../node_modules/react-native/'
更改后,删除Pod和Podfile.lock,然后重新安装您的Pod。
cd ios/
rm -rf Pods/ && Podfile.lock
pod install
最后一件事,您可以使用此upgrade helper
检查Podfile