Hoa*_*ong 7 xcode react-native react-native-ios
我用命令从expo中弹出项目npm run eject.它生成2个文件夹ios和android.我尝试运行该项目,xcode但它仍然显示此错误.也许我不清楚如何在弹出后运行项目,你可以帮我运行它.我运行一些语句来安装pod,但无法工作https://github.com/CocoaPods/CocoaPods/issues/2303
因此,在弹出时,应该为您提供两个选择:
? How would you like to eject from create-react-native-app? (Use arrow keys)
? React Native: I'd like a regular React Native project.
ExpoKit: I'll create or log in with an Expo account to use React Native and the Expo SDK.
Cancel: I'll continue with my current project structure.
Run Code Online (Sandbox Code Playgroud)
如果选择第一个(React Native),则打开Xcode项目并运行该应用程序应该没有问题(也没有要安装的Pod)。由于您的错误和注释表示相反,因此我可以假定您选择了选项2 Expokit。
为此,应该提示您一些有关建立Expo帐户或使用现有帐户的信息:
? How would you like to eject from create-react-native-app?
React Native: I'd like a regular React Native project.
? ExpoKit: I'll create or log in with an Expo account to use React Native and the Expo SDK.
Cancel: I'll continue with my current project structure.
An Expo account is required to proceed.
? It appears you're already logged in to Expo as ...
Run Code Online (Sandbox Code Playgroud)
之后,您需要按照“ 使用ExpoKit开发”中的步骤进行操作。具体来说,要使iOS运行,您需要在运行之后执行本节中的所有步骤npm run eject。
如果已完成所有操作,则在与Expo XDE或一起运行时,它应该可以正常工作exp。我现在已经对它们进行了测试,并且可以正常工作。仔细检查您的步骤,以确保您没有错过任何东西。否则,请编辑您的问题,并详细说明您所运行的命令,所拥有的其他依赖项等,因为我无法重现您的错误。
如果您想在没有 expo 的情况下下载新项目,请尝试运行:
react-native init ProjectNameHere
Run Code Online (Sandbox Code Playgroud)
或者,如果您想在没有 expo 的情况下转换您自己的项目,请尝试:
1. rm -rf node_modules
2. remove expo dependencies from package.json
3. npm install
4. react-native upgrade
Run Code Online (Sandbox Code Playgroud)
(注意:以下步骤将创建新的 ios 和 android 文件夹,您必须重做依赖项。我遇到了同样的问题,所以我发布了我的解决方案)
| 归档时间: |
|
| 查看次数: |
13909 次 |
| 最近记录: |