nickbutcher / plaid

An Android app which provides design news & inspiration as well as being an example of implementing material design.
Apache License 2.0
16.26k stars 3.16k forks source link

Question: Dynamic Features & Data Binding & MinifyEnabled #764

Open erikjhordan-rey opened 5 years ago

erikjhordan-rey commented 5 years ago

Hi! I noticed about the app crash in runtime related to shrinking enabled minifyEnabled true, Any update about this issue?

// There's a Dex Splitter issue when enabling DataBinding & proguard in dynamic features
 // The temporary workaround is to disable shrinking

https://github.com/android/plaid/blob/master/app/build.gradle#L57

rodrigojmlourenco commented 5 years ago

It seems as long as you don't obfuscaste the binding mapper, you can still have minifyEnabled true without the runtime crash.

-keep class com.example.module1.DataBinderMapperImpl { *; } 
-keep class com.example.module2.DataBinderMapperImpl { *; } 

https://stackoverflow.com/questions/54404492/proguard-with-appbundle-and-data-binding-illegalstateexception

erikjhordan-rey commented 5 years ago

thanks, of course, I tried this solution and doesn't seem it works. (maybe I missing something)