Notificare / notificare-sdk-react-native

Notificare's Official React Native Module
MIT License
6 stars 0 forks source link

🐞: Xcode build error with 4.0.0 release: 'react_native_notificare_push-Swift.h' file not found #97

Open mikkoseppa opened 3 days ago

mikkoseppa commented 3 days ago

Is there an existing issue for this?

Describe the bug

After installing 4.0.0 versions of the react-native-notificare packages, I get a build error in Xcode for every Notificare library:

I checked the derived data folder for build output, and seems like the bridging header is in fact generated successfully. For some reason Xcode can't still find it. notificare_bug

I can fix the problem by replacing the import statements in all Notificare libraries from this syntax: #import "react_native_notificare_geo-Swift.h" to this: #import "react_native_notificare_geo/react_native_notificare_geo-Swift.h"

After that Xcode can find the bridging headers and I can build all the libraries without any issue. Not sure why using this syntax works, but not the one without the subdirectory included. 🤷‍♂️

The previous react-native-notificare version 3.11.0 builds just fine.

Steps to reproduce

  1. Install 4.0.0 versions of react-native-notificare, react-native-notificare-geo, react-native-notificare-in-app-messaging, react-native-notificare-push, react-native-notificare-push-ui using yarn.
  2. Run pod install
  3. Build project In Xcode

Expected behaviour

Project builds successfully

Relevant log output

No response

Library version

4.0.0

Operating system

iOS

React Native version

0.72

Smartphone model

No response

Additional context

Cocoapods version: 1.15.2 Xcode version: 16.0 Using old RN architecture

hpinhal commented 3 days ago

Hi @mikkoseppa,

We created a brand new app that uses React Native 0.72.17 and the Notificare libraries you mentioned but cannot reproduce what you're describing. The app builds and runs successfully.

Can you create a new app and follow the same steps to check if you are still getting an error? If you can reproduce the error in a clean project, please share the project with us so we can investigate further.

Should you need to share confidential information, we recommend contacting support@notifica.re instead.

mikkoseppa commented 3 days ago

Hi @mikkoseppa,

We created a brand new app that uses React Native 0.72.17 and the Notificare libraries you mentioned but cannot reproduce what you're describing. The app builds and runs successfully.

Can you create a new app and follow the same steps to check if you are still getting an error? If you can reproduce the error in a clean project, please share the project with us so we can investigate further.

Should you need to share confidential information, we recommend contacting support@notifica.re instead.

Hi @hpinhal. Okay, so confirmed that this error happens only if you link Cocoapods libraries as static frameworks. I confirmed this with a clean RN project.

By adding this configuration to your podfile you will get the error: use_frameworks! :linkage => :static

In the previous release there was no problem using that linking method in Cocoapods.

hpinhal commented 3 days ago

Hi @mikkoseppa,

Thanks for digging into this!

The new 4.0.0 libraries adopted the new React Native plugin structure to support both old and new architectures. We'll investigate what changed there that could affect this. I'll get back to you when I have more information.

In the meantime, I would suggest avoiding static linking if possible or continuing to use 3.11.0 for the time being.