Skip to content

Commit a7818f9

Browse files
authored
ADFA-5731 | Fix plugin crashes in release builds by keeping shared dependencies (#1830)
fix(proguard): keep libraries plugins share with the app Plugins resolve shared libs parent-first from the app's dex, so R8 strips members only they call -- NoSuchMethodError on FragmentTransaction.replace and Markwon.create in release builds.
1 parent 61a2477 commit a7818f9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎app/proguard-rules.pro‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,18 @@
210210
-keep class kotlin.** { *; }
211211
-keep class kotlinx.coroutines.** { *; }
212212

213+
# Same hazard, libraries the app and plugins both ship: the app's shrunk copy
214+
# shadows the plugin's complete one. Union of plugin deps that overlap the app;
215+
# re-audit when a plugin adds one. See docs/research in plugin-examples.
216+
-keep class androidx.fragment.app.** { *; }
217+
-keep class androidx.appcompat.** { *; }
218+
-keep class androidx.core.** { *; }
219+
-keep class androidx.recyclerview.widget.** { *; }
220+
-keep class androidx.constraintlayout.** { *; }
221+
-keep class com.google.android.material.** { *; }
222+
-keep class io.noties.markwon.** { *; }
223+
-keep class com.google.gson.** { *; }
224+
213225
-keep class com.google.firebase.** { *; }
214226
-keep class com.google.android.gms.** { *; }
215227

0 commit comments

Comments
 (0)