Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: com.braze:android-sdk-location:+ causes crash #264

Closed
marc-technocrat opened this issue Aug 26, 2024 · 9 comments
Closed

[Bug]: com.braze:android-sdk-location:+ causes crash #264

marc-technocrat opened this issue Aug 26, 2024 · 9 comments
Labels

Comments

@marc-technocrat
Copy link

Which Platforms?

Android

Which React Native Version?

0.73.9

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

11.0.0

Repro Rate

100%

Steps To Reproduce

In app/build.gradle include

implementation "com.braze:android-sdk-location:+"
  1. Run the app.
  2. Crashes before RN is injected

Expected Behavior

It should boot the app

Actual Incorrect Behavior

Crashes on launch

Verbose Logs

No response

Additional Information

Can see that this was required for Braze Location and geofence functionality.
https://www.braze.com/docs/developer_guide/platform_integration_guides/android/changelog/#2410
Team has steadily updated Braze.

@marc-technocrat marc-technocrat changed the title [Bug]: [Bug]: com.braze:android-sdk-location:+ causes crash Aug 26, 2024
@amitkumar144
Copy link

you need to remove this

implementation "com.braze:android-sdk-ui:+"

@marc-technocrat
Copy link
Author

@amitmehtacode don't have that line in our code

@bryanlogan
Copy link
Collaborator

bryanlogan commented Aug 26, 2024

@marc-technocrat We'll look into how to make the location match the shipped version better. For now, can you set the location version to the Android SDK version that's specified in the release notes of the Braze React Native SDK?

@marc-technocrat
Copy link
Author

marc-technocrat commented Aug 26, 2024

@bryanlogan Which version?
We have the 11.0.0 react native sdk.

This is working
implementation "com.braze:android-sdk-location:31.1.0"

Would this be a temporary solution until you fix it on your backend?

@bryanlogan
Copy link
Collaborator

Yes, that would be a temporary solution.

@radixdev
Copy link

Hello @marc-technocrat et al,

For each SDK wrapper, we do compatibility testing with each released version of the core native (android and iOS) Braze SDKs. You can see that version here. Until we make an official release of the upstream wrapper (in this case React), we do not recommend using a different version of the underlying native SDK.

However, in order to fix your crash and be able to use the location library, we recommend adding this to your root level build.gradle file.

allprojects {
    configurations.all {
        resolutionStrategy {
            force 'com.braze:android-sdk-ui:+'
        }
    }
}

The cause of the crash is that our wrapper dependency is compiled against a different version than the latest, which is what the + in implementation "com.braze:android-sdk-location:+" is doing. This fix is merely telling Gradle that all transitive dependencies of your app should be using the same version, which is your case would be "com.braze:android-sdk-location:+". Our location SDK pulls in com.braze:android-sdk-ui as a dependency.

Please let us know if this fixes your issue,
Julian

@marc-technocrat
Copy link
Author

@radixdev
Going forward is the intention to no longer require "com.braze:android-sdk-location:+"? If not it should be. The sdk should fully manage the native dependencies.
This a pretty poor experience to have the libraries randomly crash one day when you guys push an update. It's not a proper react-native-sdk when native dependency management is required and unreliable.

@radixdev
Copy link

Hi @marc-technocrat ,

That's excellent feedback and I've taken it to the team for review. I'll update this issue once we have more details/release date.

@jerielng
Copy link
Collaborator

Hey @marc-technocrat, we've just released version 12.2.0 which adds some safeguards around it. You can now let the Braze SDK conditionally import the precise version of com.braze:android-sdk-location by setting importBrazeLocationLibrary=true in your gradle.properties, so there is no need to include this explicitly in your build.gradle any longer.

I'll close out this issue but please reach back out if you have other questions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants
@radixdev @bryanlogan @jerielng @amitkumar144 @marc-technocrat and others