vendredi 8 mai 2020

Reflection fails in signed build Android

I'm modularising our ongoing project.

Let's say there is an app module.

And 'n' number of other modules. These modules implement app module (i.e implementation project(':app_module'))

From app module I need to launch Module 1..n

I've used reflection to get the activity reference in app_module.

val intent = Intent()
intent.setClass(context, Class.forName("com.application.myapp.HelpActivity"))
context.startActivity(intent) 

So when I run the application it works fine.

But when I generated a Signed debug build and I installed it, I got ClassNotFoundException

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.application.myapp.HelpActivity" on path: DexPathList

Any idea what's causing reflection to fail in Signed debug build ?

Note: Its not a pro-guard issue. I've disabled it and I've checked. Same issue is there.

Thank you.





Aucun commentaire:

Enregistrer un commentaire