Hi 👋
I’m experiencing a crash in Android release builds when using react-native-nitro-haptics.
The issue does not occur in debug mode.
After investigation, it turns out that R8 / ProGuard strips the com.haptics package, which causes the crash at runtime.
Adding an explicit keep rule fixes the issue.
Reproduction
- Enable minifyEnabled true for Android release
- Build a release APK
- Trigger any haptic call from react-native-nitro-haptics
- App crashes at runtime
Working Solution
Adding the following rule to android/app/proguard-rules.pro fixes the crash:
-keep class com.haptics.** { *; }
Suggested Improvement
It would be great if the library could document this ProGuard requirement in the README