Android Studio 2.1.2 NoClassDefFoundError无法初始化类javax.crypto。*

时间:2016-06-15 17:25:17

标签: java android android-studio javax.crypto

我在论坛上搜索了我的问题的解决方案,但相关问题及其解决方案对我不起作用。

我使用Android Sdk 23安装Android Studio 2.1.2以创建应用程序但是当Android Studio启动时会触发错误:NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurityManager当我尝试生成APK时也会出现类似情况错误

申请规格:

  • Android Studio 2.1.2
  • Android Sdk 23
  • Java Sdk 1.8
  • Java JRE 1.8.0_91(最近更新)

我的JRE中存在以下JAR文件:

  

JRE / LIB /安全/ local_policy.jar

     

JRE / LIB /安全/的US_export_policy.jar

这是错误代码:

Exception in Studio Core.

Could not initialize class javax.crypto.JceSecurityManager
java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurityManager
    at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
    at javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2611)
    at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:548)
    at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:527)
    at sun.security.ssl.CipherSuite.isAvailable(CipherSuite.java:194)
    at sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:346)
    at sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:304)
    at sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:626)
    at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:537)
    at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:72)
    at sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:405)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:162)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
    at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
    at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1148)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:284)
    at com.intellij.util.io.HttpRequests.access$000(HttpRequests.java:49)
    at com.intellij.util.io.HttpRequests$1RequestImpl.getConnection(HttpRequests.java:139)
    at com.intellij.ide.plugins.RepositoryHelper$2.process(RepositoryHelper.java:220)
    at com.intellij.ide.plugins.RepositoryHelper$2.process(RepositoryHelper.java:213)
    at com.intellij.util.io.HttpRequests.process(HttpRequests.java:232)
    at com.intellij.util.io.RequestBuilder.connect(RequestBuilder.java:128)
    at com.intellij.ide.plugins.RepositoryHelper.loadPlugins(RepositoryHelper.java:213)
    at com.intellij.ide.plugins.RepositoryHelper.loadPlugins(RepositoryHelper.java:124)
    at com.intellij.ide.plugins.RepositoryHelper.loadPlugins(RepositoryHelper.java:105)
    at com.intellij.ide.plugins.RepositoryHelper.loadPluginsFromAllRepositories(RepositoryHelper.java:84)
    at com.intellij.openapi.updateSettings.impl.pluginsAdvertisement.PluginsAdvertiser$5$1.run(PluginsAdvertiser.java:290)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)

生成已签名的APK ...

时触发了类似的错误
Exception in plugin Android Suport.

        Could not initialize class javax.crypto.JceSecurity
java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.JceSecurity
    at javax.crypto.Cipher.getInstance(Cipher.java:515)
    at com.intellij.ide.passwordSafe.impl.providers.EncryptionUtil.encryptKey(EncryptionUtil.java:122)
    at com.intellij.ide.passwordSafe.impl.providers.EncryptionUtil.dbKey(EncryptionUtil.java:140)
    at com.intellij.ide.passwordSafe.impl.providers.BasePasswordSafeProvider.dbKey(BasePasswordSafeProvider.java:73)
    at com.intellij.ide.passwordSafe.impl.providers.BasePasswordSafeProvider.getPassword(BasePasswordSafeProvider.java:51)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImpl.getPassword(PasswordSafeImpl.java:75)
    at org.jetbrains.android.exportSignedPackage.KeystoreStep.<init>(KeystoreStep.java:77)
    at org.jetbrains.android.exportSignedPackage.ExportSignedPackageWizard.<init>(ExportSignedPackageWizard.java:106)
    at org.jetbrains.android.actions.GenerateSignedApkAction.actionPerformed(GenerateSignedApkAction.java:74)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:182)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:311)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:958)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:124)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:281)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:109)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:513)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:45)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:533)
    at java.awt.Component.processMouseEvent(Component.java:6535)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:866)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

感谢您的帮助

1 个答案:

答案 0 :(得分:0)

看看这个question,看看是否有任何答案可以帮到你。

如果没有,请转到this link并尝试再次手动下载。