0

I inherited a React Native project (previous developer is not reachable anymore) and building the iOS App with npx react-native run-ios always fails with:

** BUILD FAILED **

The following build commands failed:
    SwiftCompile normal x86_64 Compiling\ DatabaseBridge.swift /Users/myuser/code/myapp/myapp_android/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/DatabaseBridge.swift (in target 'WatermelonDB' from project 'Pods')
    CompileSwift normal x86_64 /Users/daniel/code/myapp/myapp_android/node_modules/@nozbe/watermelondb/native/ios/WatermelonDB/DatabaseBridge.swift (in target 'WatermelonDB' from project 'Pods')
(2 failures)

Before this step i ran pod install in the ios-Folder.

My Podfile

require File.join(File.dirname(`node --print "require.resolve('expo/package.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::Version.new('12.0')
platform :ios, deployment_target

target 'MyApp' do
  use_expo_modules!
  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
  config = use_native_modules!

  pod 'simdjson', path: '../node_modules/@nozbe/simdjson'
  # use_frameworks! :linkage => :static # -> this might run into conflicts with flipper (see below)
  # 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 enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false
  )

  target 'MyAppTests' do
    inherit! :complete
    # Pods for testing
  end

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable the next line.
  use_flipper!()

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

    # target -> https://www.rubydoc.info/gems/xcodeproj/Xcodeproj/Project/Object/PBXNativeTarget
    installer.pods_project.targets.each do |target|
      case target.name
      # Ignore RCT-Folly because it only works with 9.0 as a deployment target
      when 'RCT-Folly'
        next
      else
        # Explicitly set pods deployment target for each build config to app deployment target
        target.build_configurations.each do |config|
          current_pod_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
          pod_ios_deployment_target = Gem::Version.new(current_pod_target)
          if pod_ios_deployment_target <= deployment_target
            config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
          end
        end
      end
    end
  end
end

Package Versions

From my package.json:

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

Update

After famfamfam's Comment I tried building with Xcode (Until now I tried using the integrated terminal of VS Code) and there I receive a similar yet different error message (See Image):

xcode error

Any advice on how to debug and/or fix this will be highly appreciated

Daniel
  • 329
  • 2
  • 11
  • i dont know what your lib, but I saw installWatermelonJSI not found, u can check which pod using it(check import/ check where this method from...) to see better point – famfamfam Nov 08 '22 at 15:21

0 Answers0