zmxv / react-native-sound

React Native module for playing sound clips

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update import format to XCode 14.2 compat

NaeemCheema opened this issue · comments

🪲 Description

The import #import "RCTUtils.h" in /RNSound/RNSound.m is causing issues in XCode 14.2. It looks like the same issue as this expo issue: expo/expo#15622 (comment)

For us, the expo workaround expo/expo#15655 with expo_patch_react_imports isn't consistently working, so it would be great to change the import into #import <React/RCTUtils.h>.

Is that an option? Would you accept a PR for that?

🪲 What is the observed behavior?

🪲 What is the expected behavior?

🪲 Please post your code:

This patch works for us:
diff --git a/node_modules/react-native-sound/RNSound/RNSound.m b/node_modules/react-native-sound/RNSound/RNSound.m
index df3784e..17e5894 100644
--- a/node_modules/react-native-sound/RNSound/RNSound.m
+++ b/node_modules/react-native-sound/RNSound/RNSound.m
@@ -1,10 +1,5 @@
 #import "RNSound.h"
-
-#if __has_include("RCTUtils.h")
-#import "RCTUtils.h"
-#else
 #import <React/RCTUtils.h>
-#endif
 
 @implementation RNSound {
     NSMutableDictionary *_playerPool;

💡 Does the problem have a test case?

💡 Possible solution

💡 Is there a workaround?

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

Is your issue with...

  • iOS
  • Android
  • Windows

Are you using...

  • React Native CLI (e.g. react-native run-android)
  • Expo
  • Other: (please specify)

Which versions are you using?

  • React Native Sound:
  • React Native:
  • iOS:
  • Android:
  • Windows:

Does the problem occur on...

  • Simulator
  • Device

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

  • Device: