IOS Custom Configuration (Intermediate) for React Native App

I created an intermediate configuration for my React Native application as a clone of my Release build. However, when I run react-native run-ios --configuration Staging, my build failed:

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

After inspecting the assembly, it seems that several things go wrong: 1) CodeSign works on the Release assembly like this:

CodeSign build/Build/Products/Release-iphonesimulator

2) Symbols are created from the Release assembly:

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

Various things indicate Release.

Further verification suggests that this is due to the fact that the environment variables (assemblies) are set incorrectly, for example:

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

In addition, all third-party libraries (for example, React-Native, Yoga) work in Release mode, which leads to the following things:

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

An interesting note: not all things indicate Release, in addition to the final error message, there are also things like:

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

Ld build/Build/Intermediates/flockCover.build/Staging-iphonesimulator ( CONFIGURATION .

, : 1) ( CODESIGNING_FOLDER_PATH, CONFIGURATION_BUILD_DIR ..). 2) , , (, React). ? 3) , ?

+4

Source: https://habr.com/ru/post/1685182/


All Articles