React-native-sound: '<React/RCTDefines.h> file not found' error

Created on 7 Sep 2017  路  5Comments  路  Source: zmxv/react-native-sound

I saw the PR related to this, but am still getting this error.

My app is a detached expo app

I've setup a sample app to reproduce the same issue:

https://github.com/leenasn/react-native-sound-demo-app

The above app works with Android, but doesn't compile in iOS with the above-mentioned error ' file not found'.

Any help is appreciated.

Thanks,
Leena

Most helpful comment

@stefvw93 I was able to resolve it by removing the library dependency from the project. This is what I did:

  • Removed RNSound.xcodeproj from the libraries
  • Add the below line to the Podfile
pod 'RNSound',
    :path => "../node_modules/react-native-sound"
  • Run pod install

I've updated the sample project too with the above.

https://github.com/leenasn/react-native-sound-demo-app

I am not sure why is this the case. I assume the linking is done for non-CocoaPods apps as react-native normally is not built using CocoaPods.

All 5 comments

I have the same issue, also with a detached expo app.

@stefvw93 I was able to resolve it by removing the library dependency from the project. This is what I did:

  • Removed RNSound.xcodeproj from the libraries
  • Add the below line to the Podfile
pod 'RNSound',
    :path => "../node_modules/react-native-sound"
  • Run pod install

I've updated the sample project too with the above.

https://github.com/leenasn/react-native-sound-demo-app

I am not sure why is this the case. I assume the linking is done for non-CocoaPods apps as react-native normally is not built using CocoaPods.

So the problem has been solved?

I'm not a CocoaPod user, you have to use one of the methods to install a native library, so use react-native link or use the CocoaPods-way. And with CocoaPod, I think you need to include it in the project's pod file.

Any news about this isssue?

It works fine for me

Was this page helpful?
0 / 5 - 0 ratings