Use applyMapping will lead to a compile exception, like:
R8: 'boolean readField(int)' already has a mapping
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithR8ForRelease'.
com.android.tools.r8.CompilationFailedException: Compilation failed to complete
My Android Gradle Plugin's version is 3.5.3, I find it's a question of R8. Because when disable R8, applyMapping work fine, enable the R8, it will not work. I fond that the Mapping.txt generated by R8 has the duplicate methods like this:
1:1:boolean readField(int):0 -> a
2:2:boolean readField(int):0:0 -> a
If remove one of them, it will work fine.