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]: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/appboy/enums/CardCategory #188

Closed othman95 closed 1 year ago

othman95 commented 1 year ago

Which Platforms?

Android

Which React Native Version?

0.70.6

Which react-native-appboy-sdk SDK version?

1.41.0

Repro Rate

100% of the time

Steps To Reproduce

Example:

  1. import Braze from "react-native-appboy-sdk".
  2. Braze.changeUser("id")
  3. Run the app.

Expected Behavior

I expect the app to open normally without crashing

Actual Incorrect Behavior

throwing this error "Error: Requiring module "node_modules\react-native-appboy-sdk\src\braze.js", which threw an exception: Error: Exception in HostObject::get for prop 'AppboyReactBridge': java.lang.NoClassDefFoundError: Failed resolution of: Lcom/appboy/enums/CardCategory;, js engine: hermes"

Verbose Logs

Error: Requiring module "node_modules\react-native-appboy-sdk\src\braze.js", which threw an exception: Error: Exception in HostObject::get for prop 'AppboyReactBridge': java.lang.NoClassDefFoundError: Failed resolution of: Lcom/appboy/enums/CardCategory;, js engine: hermes

Additional Information

it started today, i downgraded and updated to the newest version and the issue is there

radixdev commented 1 year ago

Can you verify what version of 'com.appboy:android-sdk-ui' you have present in your application? This looks related to the 24.0.0 release of the android SDK, which was yesterday.

GiladR1979 commented 1 year ago

Changing this to a specific version of 'com.appboy:android-sdk-ui' in the build.gradle worked for me: For 1.40.0 implementation "com.appboy:android-sdk-ui:+" -> implementation "com.appboy:android-sdk-ui:23.2.1" And for version 1.41.0 changing to implementation "com.appboy:android-sdk-ui:23.3.0" worked.

othman95 commented 1 year ago

Thank you @GiladR1979, i managed to fix it this way I didn't notice that they released android sdk 24.0.0 but the latest react native package only supports 23.3.0