Error text
ERROR: R8: Missing class com.example.Foo (referenced from: void com.example.Bar.run()) Missing classes detected while running R8. Please add the missing classes or apply additional keep rules.
ERROR: R8: Missing class com.example.Foo (referenced from: void com.example.Bar.run()) Missing classes detected while running R8. Please add the missing classes or apply additional keep rules.
While shrinking, R8 sees a reference to a class that is not there. It happens in release builds when a library's rules are missing.
build/outputs/mapping/release/missing_rules.txt. R8 writes the missing rules there.proguard-rules.pro.-dontwarn. If it is needed, write -keep.consumer-rules, and update its version../gradlew assembleRelease and open the app on a phone.# app/build/outputs/mapping/release/missing_rules.txt faylına bax
# proguard-rules.pro
-keep class com.example.Foo { *; }
-dontwarn com.example.Foo
./gradlew assembleReleaseBuild release once after adding each library so the error does not show up late.
Author and license: Nibras Code