react-native-purchases: Unable to build the app on azure DevOps: CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'PurchasesHybridCommon' from project 'Pods')

Describe the bug Hello, We are experiencing issues when trying to integrate react-native-purchases into our RN app. It’s only happening when building our IPA on the azure DevOps pipelines using a fairly standard configuration. It’s working when building/archiving locally on dev machines.

The error:

The following build commands failed:
	CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'PurchasesHybridCommon' from project 'Pods')
	CompileSwift normal arm64 /Users/runner/work/1/s/ios/Pods/PurchasesHybridCommon/ios/PurchasesHybridCommon/PurchasesHybridCommon/PurchasesHybridCommon.swift (in target 'PurchasesHybridCommon' from project 'Pods')
(2 failures)
##[error]Error: The process '/usr/bin/xcodebuild' failed with exit code 65

Here are the relevant bits:

  - task: 'CocoaPods@0'
    displayName: pod install
    inputs:
      workingDirectory: ios
  - task: Xcode@5
    displayName: Build the ${{parameters.country}} IPA
    inputs:
      actions: 'clean build'
      configuration: ${{parameters.country}}.Release
      xcWorkspacePath: ios/app.xcworkspace
      scheme: ${{parameters.country}}
      packageApp: true
      exportPath: output/iphoneos/${{ parameters.buildType }}
      signingOption: manual
     [signing options...]
+  - Purchases (3.14.1):
+    - PurchasesCoreSwift (= 3.14.1)
+  - PurchasesCoreSwift (3.14.1)
+  - PurchasesHybridCommon (2.0.1):
+    - Purchases (= 3.14.1)

+  - RNPurchases (4.5.3):
+    - PurchasesHybridCommon (= 2.0.1)

We are not using Hermes in CI/Flipper, we are not linking any pods manually.

  1. Environment
    1. Platform: macOS/azure DevOps azure pipelines docs it’s using macOS 11 Big Sur internally
    2. SDK version: 4+, react-native-purchases 4.5.3
    3. OS version: iphoneos15.2
    4. Xcode/Android Studio version: 13.3
    5. React Native version: 0.67.3
    6. SDK installation (CocoaPods + version or manual): CocoaPods 1.11.3
    7. How widespread is the issue. Percentage of devices affected. N/A
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context I was able to replicate this error once on my local machine and reinstalling pods fixed this problem and it hasn’t happened ever since. We tried multiple suggested solutions, but to no success.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

With this configuration, Xcode is trying to build the app and then archive (because packageApp is set on true). For some reason, the build is failing when you try to build just after the previous (without cleaning DerivedData). @maciejtutak was trying to reproduce that on AwesomeApp but without success.

The solution for that is to set:

actions: clean
packageApp: true

as the ‘build’ is default and redundant if we have packageApp on true

I can now report that this seems to have solved the problem. Also it cut the build time for this stage to less than half the time. What a great side effect.