Search code examples
androidandroid-gradle-pluginandroid-security

After minified enabled unable to recognize module classes in android project


My project consist of the main project and it uses a custom module I built for HTTP operations. I want to obfuscate my apk so I enabled minified to true in my both android project and module. But during runtime, I get classes in the module are not found error. Did I miss anything ? enter image description here]1


Solution

  • You need to modify your proguard file to not remove those classes.

    add something like this

    # Keep these classes
    -keep class httplibrary.a2ahttp.constant.** { *; }
    

    I can't read the error completely because you crossed a bunch of it out. However the code i provided should have the class path to what has been removed. If you add that to proguard, it will prevent it from moving those classes on you.