ExceptionInInitializerError in Android app?

后端 未结 3 762
南旧
南旧 2021-01-18 12:25

In my Android app the WebView activity class has following line,

webView.addJavascriptInterface(new JSInterface(this), \"Android\");   

And

相关标签:
3条回答
  • 2021-01-18 12:54

    Based on this documentation An ExceptionInInitializerError is thrown to indicate that an exception occurred during evaluation of a static initializer or the initializer for a static variable. Check your code has any static initialization logic.

    0 讨论(0)
  • 2021-01-18 13:04

    java.lang.ExceptionInInitializerError android OS 11

    if this is related to OkHttp then update your version 4.4.0.

    In this version its fixed.

    implementation 'com.squareup.okhttp3:logging-interceptor:4.4.0'

    thanks.

    0 讨论(0)
  • 2021-01-18 13:14

    Strange! But let me share my experience, maybe it can help someone!

    Was working on an Android app that was previously being run without any issues. After I rest my Android device and on the first install of App after the reset. I got this exception java.lang.ExceptionInInitializerError

    1. I uninstalled the app
    2. Cleaned the project
    3. Rebuild the project

    After that when I ran the app the exception was gone.

    I don't know what happened, but the above steps just solved the issue.

    0 讨论(0)
提交回复
热议问题