zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.78k stars 748 forks source link

Does not build with RN 0.66.4 and Xcode 13.2 #773

Closed teknologista closed 2 years ago

teknologista commented 2 years ago

:beetle: Description

Getting the following build errors:

node_modules/react-native-sound/RNSound/RNSound.m:231:44: Implicit declaration of function 'RCTJSErrorFromNSError' is invalid in C99

node_modules/react-native-sound/RNSound/RNSound.m:231:44: Conflicting types for 'RCTJSErrorFromNSError'
Declaration of 'RCTJSErrorFromNSError' must be imported from module 'React.RCTUtils' before it is required

node_modules/react-native-sound/RNSound/RNSound.m:231:44: Declaration of 'RCTJSErrorFromNSError' must be imported from module 'React.RCTUtils' before it is required

node_modules/react-native-sound/RNSound/RNSound.m:231:44: Declaration of 'RCTJSErrorFromNSError' must be imported from module 'React.RCTLog' before it is required

:beetle: What is the observed behavior?

Build fails on Xcode 13.2

:beetle: What is the expected behavior?

:beetle: Please post your code:

// Please post your code

:bulb: Does the problem have a test case?

:bulb: **Possible solution**

:bulb: Is there a workaround?

:bulb: If the bug is confirmed, would you be willing to create a pull request?

Is your issue with...

Are you using...

Which versions are you using?

If your problem is happening on a device, which device?

teknologista commented 2 years ago

Solved by uninstalling and reinstalling

princealirehman1 commented 2 years ago

Not working for me, Getting Implicit declaration of function 'RCTJSErrorFromNSError' is invalid in C99 Even after reinstalling

teknologista commented 2 years ago

@technyx-ali-rehman You need to remove React conditional imports

in RNSound.m file in Xcode:

Replace

#if __has_include("RCTUtils.h")
#import "RCTUtils.h"
#else
#import <React/RCTUtils.h>
#endif

with

`

import <React/RCTUtils.h>

`

See here for details on the issue:

https://github.com/LinusU/react-native-get-random-values/pull/33/commits/30267ff4e9b5e93136cc935cf0370d8a09dd3aee