firebaseionic-frameworkgradleionic3cordova-plugin-firebasex

Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext


I want to build an app with Ionic V3 for Android but I have an issue when I build it on release.

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
Exception in thread "Build Event Notification" java.lang.NoClassDefFoundError: Could not initialize class sun.security.ssl.SSLContextImpl$TLSContext
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at java.security.Provider$Service.getImplClass(Provider.java:1728)
    at java.security.Provider$Service.newInstance(Provider.java:1686)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
    at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
    at com.crashlytics.reloc.org.apache.http.ssl.SSLContexts.createDefault(SSLContexts.java:51)
    at com.crashlytics.reloc.org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:966)
    at com.crashlytics.reloc.org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:56)
    at com.crashlytics.api.net.proxy.ProxySettings.getClientFor(ProxySettings.java:56)
    at com.crashlytics.api.RestfulWebApi.notifyBuildEvent(RestfulWebApi.java:1438)
    at com.crashlytics.api.RestfulWebApi.access$100(RestfulWebApi.java:74)
    at com.crashlytics.api.RestfulWebApi$10.run(RestfulWebApi.java:1371)
    at java.lang.Thread.run(Thread.java:748)

It seems to be caused by Crashlytics (which I don't even use) which is integrated within this package https://github.com/dpa99c/cordova-plugin-firebasex.

When I build the app in debug mode, I still have the exception but the build proceed until the end and I still can run it on my phone.

How can I prevent this issue ? Is there anyway to disable entirely Crashlytics so I don't have this exception anymore ?

Thanks


Solution

  • Ok, so it was all because of the JDK version. I ended up updating the JDK and everything worked perfectly.