0

Hello I am working on the react native project which i converted to swift from objective c using this How to convert iOS react native template to swift? thread.

Now I wanted to use this https://github.com/wonday/react-native-orientation-locker to integrate this library i need to import orienation class but when i import the orientation class i am getting error

Here is the my project hierarchy

enter image description here

So my question is how we can import objective c files in swift project or how we can import the third party libraries in bridging header file

When i import it in this way

#import "Orientation/Orientation.h"

I am getting the following error

❌ error: failed to emit precompiled header '/Users/softech/Desktop/vsts-agent-osx-x64-2.136.1/_work/r2/a/Application/ios/build/VidizmoMobileApp/Build/Intermediates.noindex/PrecompiledHeaders/VidizmoMobileApp-Bridging-Header-swift_G3EOBN6WTSYG-clang_3DYYERZEW34TU.pch' for bridging header /Users/softech/Desktop/vsts-agent-osx-x64-2.136.1/_work/r2/a/Application/ios/VidizmoMobileApp-Bridging-Header.h

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening VidizmoMobileApp.xcworkspace

matt
  • 515,959
  • 87
  • 875
  • 1,141
Fahad Rehman
  • 1,189
  • 11
  • 25
  • @matt when i import this i am getting error Orienation.h not found – Fahad Rehman Jul 09 '19 at 15:04
  • @matt I got it fixed i by adding the third party module path in the HeaderSearchPath as mentioned in the third step of this guide https://facebook.github.io/react-native/docs/linking-libraries-ios – Fahad Rehman Jul 09 '19 at 15:27

1 Answers1

1

Answering my own question, as mentioned in the third step of this guide https://facebook.github.io/react-native/docs/linking-libraries-ios

I also need to add the third party module in the HeaderSearchPath array as given in the picture

enter image description here

Fahad Rehman
  • 1,189
  • 11
  • 25