Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios项目编译失败请看这里(event2/event-config.h) #370

Closed
Mr-SanShou opened this issue Feb 5, 2021 · 51 comments
Closed

ios项目编译失败请看这里(event2/event-config.h) #370

Mr-SanShou opened this issue Feb 5, 2021 · 51 comments

Comments

@Mr-SanShou
Copy link

附图vscode运行截图:
image

附图xcode报错截图:
image

xcode版本:12.4

@sunnylqm
Copy link

sunnylqm commented Feb 5, 2021

Flipper的一个依赖有问题,更新到最新版本可解决
首先cocoapods需要更新到1.10版本以上

sudo gem install cocoapods

然后修改Podfile中的use_filpper那行,添加版本

use_flipper!({ 'Flipper' => '0.75.1' })

删掉Podfile.lock文件以及pods目录
重新在ios目录下执行

pod install

@Mr-SanShou
Copy link
Author

@sunnylqm 改了跑起来还是没用啊
image

@sunnylqm
Copy link

sunnylqm commented Feb 5, 2021

删掉Podfile.lock后重新pod install

@Mr-SanShou
Copy link
Author

@sunnylqm
image

@sunnylqm
Copy link

sunnylqm commented Feb 5, 2021

删掉Podfile.lock 不是 Podfile
以及pod install命令是在项目/ios目录中执行,而不是项目根目录中

@Mr-SanShou
Copy link
Author

@sunnylqm 感谢大佬 成功了

@sunnylqm sunnylqm changed the title 初学rn,搭配好环境后生成项目文件,运行报错,求大佬帮忙解决一下,谢谢! flipper依赖造成ios项目编译失败请看这里(event2/event-config.h) Feb 10, 2021
@sunnylqm sunnylqm pinned this issue Feb 10, 2021
@sunnylqm sunnylqm changed the title flipper依赖造成ios项目编译失败请看这里(event2/event-config.h) ios项目编译失败请看这里(event2/event-config.h) Feb 10, 2021
@hw20101101
Copy link

hw20101101 commented Feb 25, 2021

@sunnylqm

按照楼主说的改了,也删掉了 Podfile.lock,但是在 ios 目录下执行 pod install 时报错,如下:
Invalid Podfile file: unknown keyword: "Flipper".

Podfile文件如下:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '10.0'

target 'ReactDemo' do
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])

  target 'ReactDemoTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  use_flipper!('Flipper' => '0.75.1')
  post_install do |installer|
    flipper_post_install(installer)
  end
end

target 'ReactDemo-tvOS' do
  # Pods for ReactDemo-tvOS

  target 'ReactDemo-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

@sunnylqm
Copy link

报错截图看下,还有执行npx react-native info看下

@hw20101101
Copy link

hw20101101 commented Feb 26, 2021

@sunnylqm

WX20210226-101722@2x

Xnip2021-02-26_10-33-03

@sunnylqm
Copy link

不好意思,少了括号,应该是
use_flipper!({ 'Flipper' => '0.75.1' })

@hw20101101
Copy link

@sunnylqm 😭 好的,我再试试,谢谢!!

@yanglvyou
Copy link

@sunnylqm 按照楼主说的改了,重新在ios下删掉了Podfile.lock,pod install, 但是还是不行!
截屏2021-02-28 下午7 45 03
截屏2021-02-28 下午7 46 59

@sunnylqm
Copy link

@yanglvyou 有什么报错

@yanglvyou
Copy link

@sunnylqm 就我发的第一张图的报错

@cmcreborn
Copy link

@sunnylqm 按照楼主说的改了,重新在ios下删掉了Podfile.lock,pod install, 但是还是不行!
截屏2021-02-28 下午7 45 03
截屏2021-02-28 下午7 46 59

pod install 或 pod update 有错误讯息吗?还是都正常install好没问题?
我用相同版本的Flipper 正常没问题

@sunnylqm
Copy link

sunnylqm commented Mar 2, 2021

@yanglvyou 报错要看xcode的截图

@yanglvyou
Copy link

@sunnylqm
截屏2021-03-03 下午5 54 40

@sunnylqm
Copy link

sunnylqm commented Mar 3, 2021

@yanglvyou 8081端口被占了,比如mcafee什么的

@yanglvyou
Copy link

@sunnylqm 惭愧,多谢了!

@Walker023
Copy link

image
image
@sunnylqm 一直运行不起来,救救孩子T_T

@sunnylqm
Copy link

sunnylqm commented Mar 10, 2021

@Memoried
facebook/react-native#30922 (comment)
cocoapods的版本问题
升级下cocoapods,删pods目录,删podfile.lock,再pod install试试

@Walker023
Copy link

@Memoried
facebook / react-native#30922(评论)
cocoapods的版本问题
升级下cocoapods,删除了pods目录,删除了podfile.lock,再将pod安装试试

终于跑起来了,谢谢大佬~

@Morphone0429
Copy link

image我这个是什么问题
@sunnylqm

@sunnylqm
Copy link

@Morphone0429 截xcode中的图

@Morphone0429
Copy link

@sunnylqm 非常抱歉,rn是个纯新手,已经搞了一天了 xcode报错
image

@sunnylqm
Copy link

@Morphone0429 pod install有任何报错吗

@Morphone0429
Copy link

@sunnylqm pod install没有报错 我已经翻墙了,应该没什么问题

@sunnylqm
Copy link

@Morphone0429 你清掉pods目录,重新pod install截图看看

@Morphone0429
Copy link

@sunnylqm 我把boost-for-react-native删除下载多次了 确定有这个文件,但是xcode中好像缺少
image

image

@sunnylqm
Copy link

你是不是用了legacy build system? @Morphone0429

@Morphone0429
Copy link

@sunnylqm xcode我都是默认的配置没有动过
image

@sunnylqm
Copy link

@Morphone0429 加我qq34731408 详细看看

@Morphone0429
Copy link

@sunnylqm 已加 感谢大佬

@Morphone0429
Copy link

我上面的解决方法是
pod cache clean --all 全局操作
进自己的项目再删pods 重新pod install
已成功运行

@caiNiao0820
Copy link

image
image

@fengdanbailu
Copy link

楼主帮忙看下
1)运行yarn ios报错如下:
/Users/gmchen/MyProgram/git_devops/xcode/AwesomeProject/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'YogaKit' from project 'Pods')
warning: no rule to process file '/Users/gmchen/MyProgram/git_devops/xcode/AwesomeProject/ios/Pods/Flipper-RSocket/rsocket/benchmarks/CMakeLists.txt' of type 'text' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/gmchen/MyProgram/git_devops/xcode/AwesomeProject/ios/Pods/Flipper-RSocket/rsocket/benchmarks/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')
warning: no rule to process file '/Users/gmchen/MyProgram/git_devops/xcode/AwesomeProject/ios/Pods/Flipper-RSocket/rsocket/README.md' of type 'net.daringfireball.markdown' for architecture 'x86_64' (in target 'Flipper-RSocket' from project 'Pods')

** BUILD FAILED **

The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/gmchen/Library/Developer/Xcode/DerivedData/AwesomeProject-dvjmlbqepqobejhakrsaiztjbanw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-EEDB620F0153517E5A4A90B5722E6E65.sh
(1 failure)

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

2)运行npx react-native info,如下:
ogon:AwesomeProject gmchen$ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 11.2.3
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 2.23 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 12.5/12E5244e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_181 - /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
bogon:AwesomeProject gmchen$ pwd
/Users/gmchen/MyProgram/git_devops/xcode/AwesomeProject

3)更改 use_flipper!({ 'Flipper' => '0.75.1' }),并删除podfile.lock,再pod install;仍然是相同的错误。(ios模拟器启动了)

@sunnylqm
Copy link

sunnylqm commented Mar 23, 2021

@fengdanbailu 我注意到你的xcode版本是12.5,这个有已知的不兼容问题,facebook/react-native#31179

建议始终使用xcode的正式版而不是测试版(而且正式版也尽量不要第一时间更新)

@fengdanbailu
Copy link

改成商店的12.4版本了,问题依旧存在,你有什么思路,我可从哪几方面做尝试呢?
模拟器能运行起来,然后窗口还是报相同的错误

@fengdanbailu
Copy link

我的重启可以了在模拟器运行了,谢了。经验教训xcode不能升级太快。

@chieway
Copy link

chieway commented Mar 26, 2021

为什么生成的项目没有podfile.lock文件啊

@sunnylqm
Copy link

sunnylqm commented Mar 26, 2021 via email

@sunnylqm sunnylqm unpinned this issue Mar 30, 2021
@mobei12
Copy link

mobei12 commented Mar 31, 2021

我的是build不成
image
@sunnylqm

@sunnylqm
Copy link

报错已经说了,需要你去掉PREFIX这个环境变量

@mobei12
Copy link

mobei12 commented Mar 31, 2021

报错已经说了,需要你去掉PREFIX这个环境变量
去掉以后就到这了,
image
我用x-code直接跑的话,可以启动Metro服务
image

@sunnylqm
Copy link

点下那个xcode里的红叉,看下具体报错

@mobei12
Copy link

mobei12 commented Mar 31, 2021

点下那个xcode里的红叉,看下具体报错
感觉又回来了😂,第一次用Xcode这些,不是很懂
image

@sunnylqm
Copy link

说明你的环境变量没有去掉啊

@OceanFlooor
Copy link

请问我这个是什么问题?
DEC37890-5A90-460D-9729-EF044D7F1C98

@DebbieL
Copy link

DebbieL commented Aug 17, 2021

image

The app identifier "org.reactjs.native.example.AwesomeProject" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string to try again.

求问各位大佬这是咋肥事?

@sunnylqm
Copy link

@DebbieL 无关的问题请重新开贴。你这个问题截图已经说得很清楚了,换个名字(bundle identifier)完事。

@DebbieL
Copy link

DebbieL commented Aug 17, 2021

@DebbieL 无关的问题请重新开贴。你这个问题截图已经说得很清楚了,换个名字(bundle identifier)完事。

好的,谢谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests