React Native App

时间:2017-09-06 18:26:11

标签: ios xcode react-native environment-variables development-environment

我已经为我的React Native应用程序创建了一个临时配置,作为我的Release版本的克隆。但是,当我运行react-native run-ios --configuration Staging时,我的构建失败了:

Installing build/Build/Products/Staging-iphonesimulator/flockCover.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/Staging-iphonesimulator/myApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

检查构建后,似乎出现了一些问题: 1)CodeSign在Release版本上运行如下:

CodeSign build/Build/Products/Release-iphonesimulator

2)从版本构建生成符号:

GenerateDSYMFile build/Build/Products/Release-iphonesimulator/flockCover.app/PlugIns/flockCoverTests.xctest.dSYM build/Build/Products/Release-iphonesimulator

其他各种事情都指向Release。

进一步检查表明这是因为我的(构建)环境变量设置不正确,例如:

export BUILT_PRODUCTS_DIR=/Users/name/github/company/app/ios/build/Build/Products/Release-iphonesimulator
export CODESIGNING_FOLDER_PATH=//Users/name/github/company/app/ios/build/Build/Products/Release-iphonesimulator/flockCover.app
export CONFIGURATION=Staging
export CONFIGURATION_BUILD_DIR=/Users/name/github/company/app/ios/build/Build/Products/Release-iphonesimulator
export CONFIGURATION_TEMP_DIR=/Users/name/github/company/app/ios/build/Build/Intermediates/ReactNativeConfig.build/Staging-iphonesimulator

此外,所有第三方库(例如React-Native,Yoga)都在发布模式下运行,结果如下:

export CLASS_FILE_DIR==/Users/name/github/company/app/ios/build/Build/Intermediates/ReactNativeConfig.build/Release-iphonesimulator/ReactNativeConfig.build/JavaClasses

一个有趣的说明,并非所有事情都指向Release,除了最终的错误信息之外,还有以下内容:

=== BUILD TARGET myApp OF PROJECT myProject WITH CONFIGURATION Staging ===

Ld build/Build/Intermediates/flockCover.build/Staging-iphonesimulator(更不用说上面的CONFIGURATION环境变量。

所以我的问题如下: 1)如何正确设置这些环境变量(具体为CODESIGNING_FOLDER_PATHCONFIGURATION_BUILD_DIR等。 2)如何在依赖库中构建一个与我的应用程序配置不同的依赖库(例如React)。我是否还需要在那里创建配置? 3)这首先是导致我的问题的原因吗?

0 个答案:

没有答案