-
Notifications
You must be signed in to change notification settings - Fork 27
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
java.lang.InstantiationError crash in prod during posthog init #135
Comments
@alekseyrozh Yeah that is strange, do you minify your app? |
@marandaneto I do minify yes, when libs require exclusions there's usually a proguard config given to exclude certain classes. Like this one: https://github.com/square/retrofit/blob/trunk/retrofit/src/main/resources/META-INF/proguard/retrofit2.pro If posthog relies on some class names being preserved, could you please provide relevant proguard config. The error itself doesn't look like its cause by minification though. I will upgrade the version and update this thread in some time, in the meanwhile could you please do the analysis of this error on your side 🙏 |
@alekseyrozh I did check and nothing was obvious. Gson uses reflection but we do have the shipped proguard rules. So minify isn't a problem afaik, otherwise it'd be crashing for everyone. We also didn't get any reports from anyone else related to Since you have the proguard mapping file so symbolicate and check the real names and line numbers.
So we know what exactly |
@alekseyrozh What is the AGP version? what is the Gradle version? do you have the R8 full mode enabled? |
@marandaneto from what I read R8 full mode is enabled by default: https://developer.android.com/build/shrink-code#full-mode. My setup if quite default:
and here is the list of plugin versions:
|
@alekseyrozh full mode is enabled after AGP >= 8, and you are using 8.3.2 so indeed it is. |
@marandaneto I tried retracing as you suggested, however in the output I saw the exact same stacktrace as I attached to this issue. Which made me realise that all other lines of code are actually using full classnames and correct line numbers. So the stack trace is actually referring to the original source code, just not the error message itself. I'm not very familiar with this procedure, so I might have missed smth. Please let me know if so ![]() |
@alekseyrozh the issue is the
InstantiationError , so I wonder if the minifyEnabled messed up the line numbers.
|
Maybe I found a possible problem #140 |
Version
3.1.1
Steps to Reproduce
This is firebase carshlytics report from a production app. It occasionally fails on startup due to the posthog crash. For a certain user it crashed 4 times in a row on this error
Android 10
Model:A5 2020
Brand:Oppo
Expected Result
Not crash
Actual Result
Stack trace points here, that leaves me fairly confused
The way I call it from my code is:

The text was updated successfully, but these errors were encountered: