- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试使用以下文件结构构建 React Native 应用程序:
Kurts-MacBook-Pro-2:lucy-app kurtpeek$ tree -L 1
.
├── README.md
├── __tests__
├── android
├── app.json
├── assets
├── index.js
├── ios
├── node_modules
├── package.json
├── src
└── yarn.lock
package.json
是
{
"name": "app",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "concurrently 'emulator @Nexus_5X_API_27_x86' 'yarn android-noavd'",
"android-noavd": "react-native run-android",
"android-px": "concurrently 'emulator @Pixel_2_API_27' 'yarn android-noavd'",
"android:release": "cross-env ENVFILE=.env.release yarn run android",
"android:staging": "cross-env ENVFILE=.env.staging yarn run android",
"build:android:dev": "cross-env ENVFILE=.env ./android/gradlew assembleRelease -p ./android/",
"build:android:release": "cross-env ENVFILE=.env.release ./android/gradlew assembleRelease -p ./android/",
"build:android:staging": "cross-env ENVFILE=.env.staging ./android/gradlew assembleRelease -p ./android/",
"clean": "concurrently 'rimraf ./android/build/' 'rimraf ./ios/build/' 'rimraf node_modules/' 'yarn cache clean'",
"codepush": "yarn codepush:ios; yarn codepush:android",
"codepush:android": "code-push release-react Lucy-Eng/LucyApp-Android android",
"codepush:ios": "code-push release-react Lucy-Eng/LucyApp-iOS ios --plistFile ios/LucyApp/Info.plist",
"codepush:ls:apps": "code-push app ls",
"codepush:ls:deploys": "echo iOS && code-push deployment ls Lucy-Eng/LucyApp-iOS; echo ANDROID && code-push deployment ls Lucy-Eng/LucyApp-Android",
"codepush:promote:android": "code-push promote Lucy-Eng/LucyApp-Android Staging Production",
"codepush:promote:ios": "code-push promote Lucy-Eng/LucyApp-iOS Staging Production",
"ios": "react-native run-ios --simulator='iPhone 7'",
"ios8": "react-native run-ios --simulator='iPhone 8'",
"ios:release": "cross-env ENVFILE=.env.release yarn run ios",
"ios:staging": "cross-env ENVFILE=.env.staging yarn run ios",
"iosx": "react-native run-ios --simulator='iPhone X'",
"lint": "eslint .",
"log:android": "react-native log-android",
"log:ios": "react-native log-ios",
"react-devtools": "react-devtools",
"start": "./node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"analytics-react-native": "^1.2.0",
"immutability-helper": "^2.5.0",
"libphonenumber-js": "^1.1.10",
"lodash": "^4.17.4",
"moment": "^2.19.0",
"moment-timezone": "^0.5.14",
"prop-types": "^15.6.0",
"querystring": "^0.2.0",
"raven-for-redux": "^1.3.0",
"react": "^16.2.0",
"react-native": "^0.53.3",
"react-native-android-keyboard-adjust": "^1.1.1",
"react-native-code-push": "^5.3.2",
"react-native-config": "^0.11.5",
"react-native-country-picker-modal": "^0.5.1",
"react-native-datepicker": "^1.6.0",
"react-native-intercom": "^8.0.0",
"react-native-keyboard-aware-scroll-view": "^0.4.4",
"react-native-markdown-renderer": "^3.1.0",
"react-native-material-kit": "git://github.com/xinthink/react-native-material-kit#95b0980",
"react-native-material-menu": "^0.2.3",
"react-native-modal": "^4.1.1",
"react-native-onesignal": "^3.0.6",
"react-native-phone-input": "^0.2.1",
"react-native-router-flux": "4.0.0-beta.27",
"react-native-sentry": "^0.35.3",
"react-native-smart-splash-screen": "^2.3.5",
"react-native-snackbar": "^0.4.3",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^4.4.0",
"react-navigation": "^1.5.11",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-devtools-extension": "^2.13.2",
"redux-form": "^7.3.0",
"redux-logger": "^3.0.6",
"redux-persist": "^4.10.1",
"redux-thunk": "^2.2.0",
"reselect": "^3.0.1",
"validator": "^10.2.0"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-eslint": "^8.0.1",
"babel-jest": "21.2.0",
"babel-preset-react-native": "4.0.0",
"code-push-cli": "^2.1.6",
"concurrently": "^3.5.1",
"cross-env": "^5.1.4",
"enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.0.4",
"eslint": "^4.8.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-import-resolver-reactnative": "^1.0.2",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-react-native": "^3.1.0",
"jest": "21.2.1",
"react-devtools": "^3.1.0",
"react-dom": "^16.0.0",
"react-test-renderer": "16.0.0-beta.5",
"rimraf": "^2.6.2"
},
"jest": {
"preset": "react-native",
"setupTestFrameworkScriptFile": "<rootDir>src/test-config/enzyme-config.js"
},
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
}
还有一个像这样的 ios/Podfile
:
target 'LucyApp' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'BatchedBridge',
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# 'RCTBridge',
# Add any other subspecs you want to use in your project
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
# Third party deps podspec link
pod 'Intercom'
pod 'CodePush', :path => '../node_modules/react-native-code-push'
pod 'SentryReactNative', :path => '../node_modules/react-native-sentry'
# Add new pods below this line
end
当我尝试在 Xcode 中构建此应用程序时,我从 SentryReactNative
收到导入错误:
同样,当我尝试使用 yarn ios
运行模拟器时,出现以下错误:
In file included from /Users/kurtpeek/Documents/Dev/lucy/lucy-app/node_modules/react-native-sentry/ios/RNSentry.m:1:
In file included from /Users/kurtpeek/Documents/Dev/lucy/lucy-app/node_modules/react-native-sentry/ios/RNSentry.h:4:
/Users/kurtpeek/Documents/Dev/lucy/lucy-app/node_modules/react-native/React/Base/RCTBridge.h:12:9: fatal error: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
** BUILD FAILED **
The following commands produced analyzer issues:
Analyze Base/RCTModuleMethod.mm normal x86_64
(1 command with analyzer issues)
The following build commands failed:
CompileC /Users/kurtpeek/Documents/Dev/lucy/lucy-app/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SentryReactNative.build/Objects-normal/x86_64/RNSentryEventEmitter.o /Users/kurtpeek/Documents/Dev/lucy/lucy-app/node_modules/react-native-sentry/ios/RNSentryEventEmitter.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/LucyApp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/LucyApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
正在关注 https://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies ,一开始我以为我可能需要将'RCTBridge'
添加到'React'
的subspec
中,这就是Podfile
中的注释行。但是,如果我取消注释该行并尝试 pod install
,我会收到“CocoaPods 找不到兼容版本”错误:
如何更新导入以构建应用程序?
最佳答案
请按照以下步骤操作。它对我有用。
终端
ios
文件夹Xcode
pod安装
.xcworkspace
文件。cmd+shift+k
) 并构建 (cmd+b
) 项目。就是这样。快乐编码:)
关于ios - React Native 构建失败 : 'React/RCTBridge.h' file not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50453883/
在这种情况下,我们在应用程序中同时使用react-native-gesture-handler Touchable和react-native Touchable。 (通过Touchables,我的意思
我有一个 MainFooter包含页脚和迷你播放器的组件,单击时动画显示为全 View 。我有一个问题,每当我们点击一个页脚选项卡时,播放器最大化然后卡在那里,没有响应。 此外,播放器内部的向下箭
我在 native react 之上使用 native 基础组件,我想知道如何在 UI 中使卡片呈圆形而不是矩形。有圆形的 Prop 吗? 最佳答案 好吧,实际上没有人能回答这个问题,但幸运的是我在
我在 native react 之上使用 native 基础组件,我想知道如何在 UI 中使卡片呈圆形而不是矩形。有圆形的 Prop 吗? 最佳答案 好吧,实际上没有人能回答这个问题,但幸运的是我在
我是 react-native 的新手,所以我认为“HTML”而不是“native”可能有点太多了,所以我的问题看起来很愚蠢。 我使用 react-native-router-flux 进行路由,并使
当我使用这个例子在我的应用程序上实现 Image-slider 时,我遇到了这个错误。 import React,{Component} from 'react' import {View,T
我正在为我们的产品使用“Native Base”组件,并且效果很好, 但我有一点被卡住了,它是关于将 Items 放入 Nativebase Picker 的问题。我的代码是这样的 渲染方法代码 -
正如文档中所建议的,我将一些长的数据获取代码移动到 native 模块中以释放 JS 线程,但我观察到这仍然阻塞了 UI。为什么会这样,我能做些什么来避免这种情况? 从 JS 调用 native 模块
我正在使用一个名为 react-native-svg 的框架在 React Native View 中绘制 SVG 元素。 我的目标是,当我点击 View 时(我在全局 View 上使用 PanRes
在 IOS 中发现错误 Native Module cannot be null 我不使用 react-native-push-notification 最佳答案 这通常发生在您未能将第三个库链接到您
当应用程序关闭时,我可以获得由 Linking.getInitialURL() 点击的深层链接网址。 .当应用程序处于后台状态时,则不会安装任何内容。所以,我什至无法通过 Linking.addEve
1) 说原生库是什么意思?什么样的图书馆?那些将用作 gradle 依赖项? 2)如何链接这些?我在使用 link 或 rnpm 时遇到了麻烦。 最佳答案 链接 native 库意味着您要将已经实现的
我需要帮助来构建我的 react 原生项目。我尝试过react-native run-android,但出现以下错误: react-native : The term 'react-native' i
我需要帮助来构建我的 react 原生项目。我尝试过react-native run-android,但出现以下错误: react-native : The term 'react-native' i
我是 React-Native 的新手,到目前为止我很喜欢它。我正在尝试创建一个屏幕(用于跨平台应用程序),右上角有一个菜单图标,单击时,我想打开一个菜单,希望使用 react-native-menu
RN doco 和其他示例展示了如何从 native iOS View Controller 启动 React-Native View ,但反之则不然。谁能解释一下我该怎么做? 最佳答案 我能够弄清楚
对于 react-native - WebStorm 用户: 我正在使用 Jet Brains IDE WebStorm 开始一个带有 React Native 的项目。 在项目 => node_mo
在升级过去的 react-native 0.60 之后......我被警告我应该取消链接所有手动链接的第 3 方库(因为 RN 现在通过自动链接处理它)。 但是,当我运行 react-native u
你可以使用像 https://github.com/tolu360/react-native-google-places 这样的库吗?在世博项目中?我假设任何 npm 库都可以添加,但是像这个 goo
我主要喜欢 React Native。自 0.22 以来一直在使用它。目前为 0.35。 但是为什么链接原生库就像抽奖一样呢?我很少在第一次拍摄时让它发挥作用,而破裂的东西通常是完全不同的东西。 每个
我是一名优秀的程序员,十分优秀!