Showkase
Showkase copied to clipboard
The library doesn't work with Proguard/R8
If the app has Proguard/R8 turned on, generated code is removed and Showkase doesn't show any components.
I workarounded it by adding an exception to Proguard rules - keep everything in a package with generated code - like this:
-keep class com.jll.jet.app.showkase.** { *; }
But probably more generic rule should be included in the library.
Are you using a release build of the Showkase browser? The primary use case of the app was in the debug mode so an R8 rule wasn't exported with the app. This is to ensure that we don't have an apk size impact on your app.
Yes we have multiple flavors of the app and the use-case is that there is a flavor for QA environment. But we want to distribute release build so QA people test as close as production app possible. But seing Showkase is useful for QA people. Maybe R8 configuration can be only in documentation, not exported in the library.
Any update on this ?
You essentially need to add a proguard keep rule to make it with in release/alternate builds. The exact keep rule depends on your setup. For example, if your ShowkaseRootModule implementation looks like this -
package my.lovely.package
@ShowkaseRoot
class MyRootModule: ShowkaseRootModule
Then your proguard rule will need to be
-keep class **.MyRootModuleCodegen { }
We are essentially trying to retain the final XCodegen class that Showkase generates. The name of this generated class is of the format (_name_of_ShowkaseRootModule_implementation_)Codegen.
Hope this makes sense!
@vinaygaba Thanks for the info. But it would be good to add this information to README before closing this issue.