我可以编写一个 Android 应用程序,然后使用 react-native 构建一个 IOS 应用程序吗?

黑白棋

我开始学习 react-native 并且在设置环境时遇到了一些问题,我对此有一些疑问:

首先当我写:

npx react-native init new_app

我收到一个错误,该错误说尝试:

cd ./new_app/ios && pod install

然后我收到以下错误:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for arm-apple-darwin-gcc... /Library/Developer/CommandLineTools/usr/bin/cc -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
/Users/macbookpro/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing: Unknown `--is-lightweight' option
Try `/Users/macbookpro/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/macbookpro/Library/Caches/CocoaPods/Pods/Release/Flipper-Glog/0.3.6-1dfd6':
configure: error: C compiler cannot create executables
See `config.log' for more details

我知道我需要安装 Xcode,但由于某些原因我现在不想安装,那么我可以做些什么来让它在没有安装 Xcode 的情况下工作?

第二个问题,如何首先为 Android 初始化一个 react-native 应用程序?如果有办法做到这一点,当我想构建 IOS 应用程序时,我会遇到一些麻烦还是只需要 Xcode 然后为 IOS 构建相同的 android 代码?还是应该为 IOS 和 Android 准备好环境然后开始处理您的应用程序?

质量管理器

要回答您的第一个问题,不幸的是,如果您想为 IOS 构建应用程序,则需要 Xcode。

要回答您的另一个问题,完全可以为 android 而不是 IOS 构建。他们的构建过程在很大程度上相互独立。在这里,我将省去您为 android 构建和开发的所有步骤,但文档应该为您提供所需的一切。https://reactnative.dev/docs/running-on-device

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

从iOS中的另一个应用程序打开设置应用程序-React Native

我应该使用一个iOS发行证书来签署不同的应用程序吗?

您可以在Ubuntu上构建React Native应用程序(Android应用程序)吗?

我可以使用react native使用Django rest api构建移动应用程序吗?

React JS Web代码可以用于使用React Native构建移动应用程序吗?

Facebook iOS应用程序是在React Native中内置的吗?

无法为Android构建的React Native应用程序-SyntaxError:\ u只能跟一个Unicode字符序列

React Native-在一个屏幕中显示两个应用程序栏

使用另一个应用程序在React-Native应用程序中打开下载的文件

Flutter没有构建iOS应用程序,这是一个迅速的错误吗?

android:React native从另一个应用程序打开一个应用程序?

可以分发一个未发布的react-native ios应用程序吗?

React Native Android应用程序在一个移动设备上运行但在另一个移动设备上崩溃(通过Google Play商店生产)

一个Azure移动应用程序服务可以用于Android和iOS应用程序吗?

如何在React Native上的Kill应用程序中检测到一个应用程序?

一个应用程序可以访问Android中另一个应用程序的屏幕吗?

用Kotlin编写的Android Native应用程序和React Native应用程序

您可以在带有Xcode子项目的另一个iOS应用程序中运行一个iOS应用程序吗?

一个应用程序可以在android和ios上运行吗

我可以在Ice Cream Sandwich 4.0.4上使用Webkit 537.36开发一个Android Web应用程序吗

使用iOS模拟器运行第一个React Native应用程序时未找到index.io.bundle

我可以在Windows PC上开发React Native IOS应用程序吗

如何为 Android 制作一个关于 React Native 应用程序的包

我能否使用 React Native 框架在 Mountain Lion 中编写/发布 iOS 和 Android 应用程序?

是否可以在 Windows 笔记本电脑中使用 React Native 构建 android 和 iOS 应用程序?

为 ios 和 android 动态更新应用程序构建版本 - React Native

我可以在 react-native 应用程序的两个不同组件中使用一个 mobx 商店吗?

我如何从 Xcode 修复这个错误,构建一个 iOS 应用程序?

使用 forcereact 创建的 Salesforce React Native 示例应用程序无法在 iOS 中构建,但不能在 Android 中构建