didomi / react-native

Didomi SDK for React Native
Other
9 stars 2 forks source link

[BUG] Missing classes detected while running R8 #109

Closed rtorrente closed 4 months ago

rtorrente commented 4 months ago

Summary

When compiling with minifyEnabled, the task minifyReleaseWithR8 prints error, such as:

ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /home/expo/workingdir/build/android/app/build/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class kotlinx.parcelize.Parcelize (referenced from: io.didomi.sdk.H4 and 10 other contexts)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
   > Compilation failed to complete
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 9m 52s

The file missing_rules.txt say

# Please add these rules to your existing keep rules in order to suppress warnings.
# This is generated automatically by the Android Gradle plugin.
-dontwarn kotlinx.parcelize.Parcelize

To reproduce

Maybe the lib don't declare their consumer proguard rules ?

Versions

pmerlet-at-didomi commented 4 months ago

Hello @rtorrente , thanks for your feedback. Please note that we do not officially support Expo, as we did not test our plugin on this framework.

The library declares some proguard rules, but we don't have the rule -dontwarn kotlinx.parcelize.Parcelize. Can you add it to your app? I am not sure it is possible to directly modify android/app/proguard-rules.pro in expo, but you can try these instructions: https://gist.github.com/esinanturan/3e510444c602796694dee5943470c742

rtorrente commented 4 months ago

Hello @pmerlet-at-didomi yes it works well when I add the proguard rules

I opened the issue because I think it's better to update the lib in long term. But yes my issue is not blocking right now

pmerlet-at-didomi commented 4 months ago

OK, thanks for explaining. Yes, we can certainly add this proguard rule in a future release.

pmerlet-at-didomi commented 4 months ago

@rtorrente The proguard rule was added in the new version https://github.com/didomi/react-native/releases/tag/2.2.0 , can you check if this fixes your issue? Thanks!

rtorrente commented 4 months ago

Hello @pmerlet-at-didomi, i can confirm that 2.2.0 fixes the issue :)

Thanks !