-
Notifications
You must be signed in to change notification settings - Fork 867
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
Raised ExceptionInInitializerError after applied proguard in Android #412
Comments
We're going to need some more information to figure that out. For instance,
there is no Rhino code in that stack trace. There is a class called
"Context" but it only has 2789 lines...
…On Wed, Mar 21, 2018 at 1:56 AM, Ganesh Krishnamoorthy < ***@***.***> wrote:
Hi, Please check the below error and tell me the solution for this.
java.lang.ExceptionInInitializerError
at org.a.b.l.a(Context.java:396)
at org.a.b.l.b(Context.java:3391)
at com.xx.yy.view.Activity.g(MyActivity.java:16)
at com.xx.yy.view.Activity.onActivityResult(MyActivity.java:235)
at android.app.Activity.dispatchActivityResult(Activity.java:6931)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4090)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4137)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1529)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(
ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#412>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAf0a51EGxmj1u0LmXgzDU6rHXwCUDArks5tghWhgaJpZM4SzMcw>
.
|
I could provide a min of code instead of all. Pls check below. This is my code,
And i have referred at Android docs that mentioned of ExceptionInInitializerError occur at static initializer state,
As i can see you have used static method to initialize the context. Pls refer below,
I thought it raised might be of this. Pls help me to fix it. |
@macroday
class A {
static int i;
static {
// make initializer fail
i = 1 / 0;
}
} Could you please post a proguard config that you’re using? I think one of the classes required by Also, this exception should have a |
I have attached my proguard rules at below.
This error occur when i comment the below statements in proguard rules,
I think the cause of error due to use the Context with package because while optimizing the app android will change the all package name. Please give me a better solution to fix it soon. |
Hi, Please check the below error and tell me the solution for this.
java.lang.ExceptionInInitializerError
at org.a.b.l.a(Context.java:396)
at org.a.b.l.b(Context.java:3391)
at com.xx.yy.view.Activity.g(MyActivity.java:16)
at com.xx.yy.view.Activity.onActivityResult(MyActivity.java:235)
at android.app.Activity.dispatchActivityResult(Activity.java:6931)
at android.app.ActivityThread.deliverResults(ActivityThread.java:4090)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:4137)
at android.app.ActivityThread.-wrap20(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1529)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
The text was updated successfully, but these errors were encountered: