react-native-notifications icon indicating copy to clipboard operation
react-native-notifications copied to clipboard

Minification failure with R8: Compilation failed for ReactAppLifecycleFacade$1 in react-native-notifications

Open Calderis opened this issue 1 year ago • 0 comments

I encountered an issue while trying to minify my React Native application with R8. The build fails with the following error related to the ReactAppLifecycleFacade$1 class from the react-native-notifications module:

Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete, origin: /path/to/project/node_modules/react-native-notifications/lib/android/app/build/intermediates/runtime_library_classes_jar/reactNative60Release/classes.jar:com/wix/reactnativenotifications/core/ReactAppLifecycleFacade$1.class

Reproducing the Issue :

  1. Update react-native-notifications to the latest version.
  2. Enable minification in android/app/build.gradle.
  3. Attempt to build the release version using R8 with ./gradlew assembleRelease --info in android folder

Expected behavior :

The application should build successfully with R8 enabled for minification.

Actual behavior :

The build fails with the mentioned error related to the ReactAppLifecycleFacade$1 class.

Environment Information :

  • React Native version: 0.71.8
  • react-native-notifications version: 5.1.0
  • Node.js version: v16.14.0
  • yarn version: 1.22.19

I have tried the following solutions based on online recommendations:

  • [x] Updating all project dependencies.
  • [x] Checking community forums and discussions.

I appreciate your assistance in resolving this issue. Please let me know if any further information is needed.

Calderis avatar Feb 19 '24 09:02 Calderis