Monday, December 5, 2022
HomeiOS Developmentios - The next construct instructions failed: SwiftCompile regular x86_64 Compiling DatabaseBridge.swift...

ios – The next construct instructions failed: SwiftCompile regular x86_64 Compiling DatabaseBridge.swift (in goal ‘WatermelonDB’ from mission ‘Pods’)


I inherited a React Native mission (earlier developer is just not reachable anymore) and constructing the iOS App with npx react-native run-ios all the time fails with:

** BUILD FAILED **

The next construct instructions failed:
    SwiftCompile regular x86_64 Compiling DatabaseBridge.swift /Customers/myuser/code/myapp/myapp_android/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/DatabaseBridge.swift (in goal 'WatermelonDB' from mission 'Pods')
    CompileSwift regular x86_64 /Customers/daniel/code/myapp/myapp_android/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/DatabaseBridge.swift (in goal 'WatermelonDB' from mission 'Pods')
(2 failures)

Earlier than this step i ran pod set up within the ios-Folder.

My Podfile

require File.be part of(File.dirname(`node --print "require.resolve('expo/package deal.json')"`), "scripts/autolinking")
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

deployment_target = Gem::Model.new('12.0')
platform :ios, deployment_target

goal 'Evolute' do
  use_expo_modules!
  post_integrate do |installer|
    start
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    finish
    start
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    finish
  finish
  config = use_native_modules!

  pod 'simdjson', path: '../node_modules/@nozbe/simdjson'
  # use_frameworks! :linkage => :static # -> this may run into conflicts with flipper (see beneath)
  # or:
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi', :modular_headers => true
  pod 'SDWebImage', :modular_headers => true
  pod 'SDWebImageWebPCoder', :modular_headers => true

  use_react_native!(
    :path => config[:reactNativePath],
    # to allow hermes on iOS, change `false` to `true` after which set up pods
    :hermes_enabled => false
  )

  goal 'EvoluteTests' do
    inherit! :full
    # Pods for testing
  finish

  # Permits Flipper.
  #
  # Be aware that you probably have use_frameworks! enabled, Flipper is not going to work and
  # it's best to disable the subsequent line.
  use_flipper!()

  post_install do |installer|
    react_native_post_install(installer)
    # Uncomment if utilizing a M1 Mac with XCode 12.5
    # __apply_Xcode_12_5_M1_post_install_workaround(installer)

    # goal -> https://www.rubydoc.information/gems/xcodeproj/Xcodeproj/Mission/Object/PBXNativeTarget
    installer.pods_project.targets.every do |goal|
      case goal.title
      # Ignore RCT-Folly as a result of it solely works with 9.0 as a deployment goal
      when 'RCT-Folly'
        subsequent
      else
        # Explicitly set pods deployment goal for every construct config to app deployment goal
        goal.build_configurations.every do |config|
          current_pod_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
          pod_ios_deployment_target = Gem::Model.new(current_pod_target)
          if pod_ios_deployment_target <= deployment_target
            config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
          finish
        finish
      finish
    finish
  finish
finish

I observed within the error-message the trail factors to watermelonDB inside .../myapp_android/.... However after I add

pod 'WatermelonDB', path: '../node_modules/@nozbe/watermelondb'

to the Podfile, I get the error

error React Native CLI makes use of autolinking for native dependencies, however the next modules are linked manually: 
  - @nozbe/watermelondb (to unlink run: "react-native unlink @nozbe/watermelondb")

and the construct nonetheless fails with the identical error.

Bundle Variations

From my package deal.json:

...
"@nozbe/watermelondb": "^0.24.0",
"react-native": "0.67.2",
...

Any recommendation on debug and/or repair this will likely be extremely appreciated

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments