dd-sdk-reactnative: Error on IOS build - 1.8.0 sdk version

Describe what happened

When i try build ios got this error

`@datadog/mobile-react-native/ios/Sources/DdTrace.mm:7:9: fatal error: 'DatadogSDKReactNative-Swift.h' file not found

#import <DatadogSDKReactNative-Swift.h> `

Steps to reproduce the issue:

Describe what you expected:

Additional context

  • Version of the SDK: 1.8.0
  • Version of React Native: 0.72
  • package.json
  • Podfile and Podfile.lock
  • android/build.gradle and android/app/build.gradle

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 20 (7 by maintainers)

Most upvoted comments

Hi all,

The fix for this issue has been released in version 1.8.1 of @datadog/mobile-react-native. Thanks a lot for all your inputs in solving this issue!

Feel free to reopen the issue if the problem persists.

in our case it was fixed by replacing: #import <DatadogSDKReactNative-Swift.h> by #import <DatadogSDKReactNative/DatadogSDKReactNative-Swift.h> in the *.mm files

Hi @fmedinac, thanks for reporting!

First I apologize for this version creating so much trouble, it looks like the migration to the new architecture is not going as smoothly as we hoped even after our testing.

@fmedinac your error seems a little bit different, it looks like XCode is trying to find the Dd{Sdk,Trace,Rum,Logs}.swift files that were renamed into Dd{Sdk,Trace,Rum,Logs}Implementation.swift in version 1.8.0.

This looks like some XCode cache issue, I tried to reproduce it by upgrading @datadog/mobile-react-native without any success.

Maybe the easiest way to try to fix it would be to:

  • close XCode
  • Remove @datadog/mobile-react-native from your dependencies
  • Run pod install (hoping it will remove reference to previous files)
  • Add @datadog/mobile-react-native back
  • Run pod install again

If that does not work, can you try the following:

  • Clean the DerivedData from XCode (rm -rf ~/Library/Developer/Xcode/DerivedData)
  • Clear the Cocoapods cache: pod cache clean --all
  • Delete ios/Pods then run pod install again
  • Open your project on XCode (you can run xed ios) and build it from there

As a last resort, can you try the solution described here?

Let me know if this fixes your issue. If not, don’t hesitate to reach out to our support team so we can more easily share ideas.

in our case it was fixed by replacing: #import <DatadogSDKReactNative-Swift.h> by #import <DatadogSDKReactNative/DatadogSDKReactNative-Swift.h> in the *.mm files

@msouzadev @adscud could you try to apply these changes and let us know if that fixes the issue for you? If so we can release a new patch version with this change.