braze-inc / braze-react-native-sdk

Public repo for the Braze React Native SDK
https://www.braze.com
Other
64 stars 84 forks source link

[Bug]: Build fails on React Native 0.76.0 and 0.76.1 #273

Closed edapess closed 1 week ago

edapess commented 1 month ago

Which Platforms?

iOS

Which React Native Version?

0.76.0 / 0.76.1

Which @braze/react-native-sdk SDK version?

13.1.1

Repro Rate

100% of time

Steps To Reproduce

Example:

  1. update React Native to 0.76.
  2. try to build
  3. build fails
  4. update @braze/react-native-sdk to latest 13.1.1
  5. try to build
  6. fails

Expected Behavior

Application need to build correctly

Actual Incorrect Behavior

Build Fails

Verbose Logs

'optional' file not found 
while building module 'RCTTypeSafety' imported from .../ReactCodegen/ReactCodegen.framework/Headers/BrazeReactModuleSpec/BrazeReactModuleSpec.h:24:

Additional Information

Screenshot 2024-10-30 at 4 17 15 PM Screenshot 2024-10-30 at 4 17 21 PM

jerielng commented 1 month ago

Hi @edapess, we are unable to reproduce this in our sample app. There were a couple of notable changes in React Native 0.76, namely that the New Architecture is now enabled by default. One thing to note is that the pod install semantics have changed, which can have implications on how you build your project. Could you verify which architecture your application is using, and check which command you are using to pod install? To note, the Braze React Native SDK is supported on both the New Architecture and the legacy architecture.

Additionally, there are often other parallel dependencies you may need to upgrade in your package.json when updating your project to the latest version of React Native. This can often lead to incompatibilities and consequently build failures if they aren't upgraded together. You can use this helpful community tool to determine which other dependencies you may need to upgrade.

If you are still facing issues, please feel free to write in to support@braze.com and reference this GitHub issue. Thanks!

edapess commented 1 month ago

@jerielng I know about upgrade helper, also I tried install pods with both old/new architecture, let me remove all my node modules, caches, cz I had many issues related to other packages, and the last one (maybe) is the error above that i mentioned.

let me check again and get back to this thread :)))

edapess commented 4 weeks ago

@jerielng So I build IOS with old architecture, but on Android I'm getting this Screenshot 2024-10-31 at 10 50 07 AM

mobinni commented 4 weeks ago

I am facing similar errors when building on 0.76

Screenshot 2024-10-31 at 9 02 18 AM
jerielng commented 4 weeks ago

@edapess @mobinni Could you both write in to support@braze.com with further details about your projects:

and they will be able to help you troubleshoot and diagnose the issue? Thanks!

mobinni commented 4 weeks ago

I'm not sure I can provide that information, however what I can provide:

I have tried on 0.75.6 and 0.76.1 new architecture, same issue arises. I will try to put together a demo app with the issue. I do see the Braze sample app on this repo is still on 0.71

jerielng commented 4 weeks ago

@mobinni I believe the package.json you are looking at is for the SDK, which uses 0.71.0 as a minimum but does not lock users to that specific version.

The package.json for our public sample app is currently using 0.75.2, but we have internally tested with 0.76.1 without being able to reproduce these build errors on either Android or iOS for either architecture of React Native. You may use this updated file as a cross-reference: package.json

edapess commented 4 weeks ago

@mobinni i built successfully with old architecture (0.76), you have to remove Podfile.lock, clean cache, derived data and after install pods using old arch. - RCT_NEW_ARCH_ENABLED=0 bundle exec pod install

I will try today again with new architecture

edapess commented 3 weeks ago

@jerielng I think it's related to this https://github.com/CocoaPods/CocoaPods/issues/12105, also tommorow i will write to support

hosseintalebi commented 3 weeks ago

I'm running into a similar issue. I'm trying to run the app on the new architecture:

image

alzalabany commented 3 weeks ago

Same issue, not able to use when new arch =true

jerielng commented 3 weeks ago

@hosseintalebi @alzalabany Could you cross-reference your package.json with the one linked here and verify if there are any mismatching React Native dependencies? For a deeper investigation into your project, we would recommend reaching out to our support team at support@braze.com to debug the issue further. Thanks!

QSuraj commented 2 weeks ago

+1

Facing same issue on 0.76.1 -

image
jerielng commented 2 weeks ago

@QSuraj Likewise, could you also write in to support@braze.com with further details of your integration, as mentioned above? We would like to understand the common thread behind these build errors to further diagnose them as we are not able to reproduce them from our end. Thanks!

alzalabany commented 1 week ago

In braze repo new arch is disabled. Please either use a new Reactnative project or enable newarch and issue should be reproduced on android

sircelsius commented 1 week ago

Hi everyone.

To clarify, we do have newArchEnabled=true in gradle.properties.

Given that we have not been able to reproduce this issue with the currently provided reproduction steps, we suggest that if you were not able to address the issue you contact support@braze.com where we will be able to ask for more information relative to your exact environment.