哪个是创建react native应用的正确过程。 create-react-native-app MyReactNative或react-native初始化MyReactNative?

问题描述 投票:0回答:1

我是React Native应用程序的新手。我正在将我的本地iOS Framework集成到示例react本地应用程序中。当我尝试创建示例应用程序时,我看到了两个创建选项,并在下面添加了以下内容:

1:npm install -g create-react-native-app:

在我的系统中成功安装NodeJS和NPM之后,我使用了以下命令:npm install -g create-react-native-app

为了创建项目,我遵循以下命令:create-react-native-app MyReactNative

Ref: https://www.tutorialspoint.com/react_native/react_native_environment_setup.htm

我可以使用“ user_framework!”在pod文件中,添加了快速的本机依赖关系,以及一个响应本机依赖关系的静态库,我可以运行该应用程序。

2.react-native init MyReactNative:

我已经按照以下命令创建了项目:react-native init MyReactNative

但是当我使用“ user_framework!”在pod文件和添加的快速本机依赖项中,我无法运行该应用程序。我正在使用该dyld:库未快速加载依赖项。

参考:https://www.smashingmagazine.com/2016/04/the-beauty-of-react-native-building-your-first-ios-app-with-javascript-part-1/

ios objective-c swift react-native command-prompt
1个回答
0
投票

使用第二个选项创建本机应用程序。

react-native init MyReactNative

并且对于此错误:dyld:库未快速加载库。

1) first check **framework** compatible with iphone simulator.

2) Drag and drop **user_framework** in your project navigation. Link framework 
   and Library added this library.

3) In Xcode go to Project -> General -> Embedded Binary -> Add user_framework. 
 (if xcode 10.1 or below) or Project > Framworks,Libraries,and Embeded content 
  (xcode 11 or above )

4) Make sure that in Build Phases tab Link Binary with Libraries (have 1 item) 
  and Embed Frameworks (have 1 item) do exist.
© www.soinside.com 2019 - 2024. All rights reserved.