superwall / react-native-superwall

Remotely configure every aspect of your paywall and double your revenue.
MIT License
22 stars 0 forks source link

ClassNotFoundException after installing @superwall/react-native-superwall on Xiaomi Redmi 9T #8

Open khanhkom opened 3 months ago

khanhkom commented 3 months ago

image image

After installing the @superwall/react-native-superwall library in my React Native project, I'm encountering a ClassNotFoundException on my Xiaomi Redmi 9T device. The error occurs when trying to launch the app. Error details: CopyCaused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.ReportFragmentActivityInitializationListener" on path: DexPathList[[zip file "/data/app/vn.com.eatsy-FFsB7KP-rqp_v8JW5dONWg==/base.apk"],nativeLibraryDirectories=[/data/app/vn.com.eatsy-FFsB7KP-rqp_v8JW5dONWg==/lib/arm64, /data/app/vn.com.eatsy-FFsB7KP-rqp_v8JW5dONWg==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]] Project configuration:

Device: Xiaomi Redmi 9T React Native version: [Please specify your RN version] @superwall/react-native-superwall version: [Please specify the version]

Build configuration: CopybuildToolsVersion = "34.0.0" minSdkVersion = 26 compileSdkVersion = 34 targetSdkVersion = 34 androidXVersion = "1.0.0" ndkVersion = "23.1.7779620" googlePlayServicesAuthVersion = "19.2.0" kotlinVersion = '1.8.0' gradle version: 8.2 Steps to reproduce:

Install @superwall/react-native-superwall Run the app on a Xiaomi Redmi 9T device App crashes with the above ClassNotFoundException

I've tried cleaning and rebuilding the project, updating Gradle files, and ensuring the library is properly linked, but the issue persists. Any assistance in resolving this would be greatly appreciated.

ianrumac commented 3 months ago

Hi @khanhkom !

This sounds like a potential Multidex error - on Android, DEX files are allowed to contain only 65.5k methods, so sometimes adding a certain library could cause it so it overflows the dex files - the ClassNotFoundException pointing to the dex file is the indicator. Could you follow this guide to enable Multidex in your app and let us know if that resolves the issue?

khanhkom commented 3 months ago

@ianrumac Thank you for support, i follow all step in guide, but it still not working. Should we uninstall some library to solve this problem?