Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when proguard is enabled #11

Open
jimlyas opened this issue Mar 25, 2022 · 3 comments
Open

NullPointerException when proguard is enabled #11

jimlyas opened this issue Mar 25, 2022 · 3 comments

Comments

@jimlyas
Copy link

jimlyas commented Mar 25, 2022

So I'm getting this error when enabling proguard:

Caused by: java.lang.RuntimeException: javaClass.superclass must not be null
        at na4.z(com.google.android.gms:play-services-mlkit-barcode-scanning@@18.0.0:10)
        at com.devbase.presentation.viewbinding.DevActivity.onCreate(DevActivity.kt:3)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)

I deduce because of this.

When proguard is disabled, all is running well.

Thanks in advance.

@Jintin
Copy link
Owner

Jintin commented Mar 25, 2022

Hi, not sure if you follow this proguard rule already?

First of all, BindingExtension using refelction a lot to link many things internally in order to provide simple usage. To prevent having trouble with proguard, please remember to exclude ViewBinding related method in your proguard-rules file like this:

-keepclassmembers class * implements androidx.viewbinding.ViewBinding {
public static ** inflate(...);
}

https://github.com/Jintin/BindingExtension#usage

@jimlyas
Copy link
Author

jimlyas commented Mar 26, 2022

Yes, I have. I included it already in my proguard configuration.

@Jintin
Copy link
Owner

Jintin commented Apr 1, 2022

If it works without proguard means there's something in proguard affect the binding process.
May you describe more about your class hierarchy like is DevActivity inherit from BindingActivity directly or what's the different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants