首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决React Native中"folly/Portability.h“和”File.../main.jsbundle不存在“的问题?

如何解决React Native中"folly/Portability.h“和”File.../main.jsbundle不存在“的问题?
EN

Stack Overflow用户
提问于 2019-04-23 06:15:26
回答 1查看 2.4K关注 0票数 6

当我想要为生产环境编译我的IOS应用程序时,出现了这个错误:'folly/Portability.h' file not foundecho 'error:this File .../main.jsbundle does not exist. This must be a bug with我已经搜索了互联网来解决这个问题,但是我不能解决它

以下是react-native的信息:

代码语言:javascript
复制
  React Native Environment Info:
System:
  OS: macOS 10.14.4
  CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
  Memory: 38.35 MB / 8.00 GB
  Shell: 3.2.57 - /bin/bash
Binaries:
  Node: 10.15.0 - /usr/local/bin/node
  npm: 6.9.0 - /usr/local/bin/npm
  Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
  iOS SDK:
    Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
  Android SDK:
    API Levels: 21, 22, 24, 25, 26, 27, 28
    Build Tools: 25.0.0, 26.0.0, 26.0.2, 26.0.3, 27.0.1, 27.0.3, 28.0.3
    System Images: android-18 | Google APIs Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-24 | Google APIs Intel x86 Atom, android-25 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
  Android Studio: 3.4 AI-183.5429.30.34.5452501
  Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
  react: 16.6.3 => 16.6.3 
  react-native: ^0.59.6 => 0.59.6 
npmGlobalPackages:
  react-native-cli: 2.0.1
  react-native-rename: 2.4.1

下面是我的Pod的配置

代码语言:javascript
复制
platform :ios, '9.0'

target 'AppXYZ' do

  # Pods for AppXYZ

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 5.15.0'
  pod 'Firebase/Messaging', '~> 5.15.0'

  pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage'
  pod 'react-native-netinfo', :path => '../node_modules/@react-native-community/netinfo'

  pod 'React', :path => '../node_modules/react-native'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
  # Third party deps podspec link
  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'

  target 'AppXYZTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

为了解决我在互联网上发现的第一个问题('folly/Portability.h'),这个(但它不起作用)

代码语言:javascript
复制
      # Third party deps podspec link
  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'

为了解决第二个问题,我发现了这个:react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios/assets,但它不工作,它为我生成了另一个错误:

代码语言:javascript
复制
Loading dependency graph...error jest-haste-map: Haste module naming collision:
  Duplicate module name: react-native
  Paths: .../ios/Pods/React/package.json collides with .../node_modules/react-native/package.json

这些代码行必须解决这个问题(但它不能解决)

代码语言:javascript
复制
  pod 'React', :path => '../node_modules/react-native'
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'

有人能帮我,因为我被卡住了

EN

回答 1

Stack Overflow用户

发布于 2019-05-14 21:45:00

只需拖放Folly文件夹到“头搜索路径”框中的构建设置选项卡中的Pods项目设置和重建。见下图

search header path setting

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55801798

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档