Android Studio - 生成发布apk“错误敲定密码”

时间:2018-04-03 13:05:25

标签: android android-studio encryption apk release

我在Android Studio中尝试生成发布APK时发生以下错误。

InvocationTargetException: org.bouncycastle.crypto.io.InvalidCipherTextIOException Error finalising cipher
org.picocontainer.defaults.PicoInvocationTargetInitializationException: InvocationTargetException: org.bouncycastle.crypto.io.InvalidCipherTextIOException Error finalising cipher
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:110)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:80)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:63)
    at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:220)
    at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:239)
    at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:206)
    at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:49)
    at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:39)
    at com.intellij.ide.passwordSafe.PasswordSafe.getInstance(PasswordSafe.java:28)
    at org.jetbrains.android.exportSignedPackage.KeystoreStep.retrievePassword(KeystoreStep.java:96)
    at org.jetbrains.android.exportSignedPackage.KeystoreStep.<init>(KeystoreStep.java:81)
    at org.jetbrains.android.exportSignedPackage.ExportSignedPackageWizard.<init>(ExportSignedPackageWizard.java:112)
    at org.jetbrains.android.actions.GenerateSignedApkAction.actionPerformed(GenerateSignedApkAction.java:74)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:321)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:911)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:136)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:311)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:130)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120)
    at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:130)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:521)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:48)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:541)
    at java.awt.Component.processMouseEvent(Component.java:6541)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:646)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
    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)
Caused by: org.bouncycastle.crypto.io.InvalidCipherTextIOException: Error finalising cipher
    at org.bouncycastle.crypto.io.CipherInputStream.finaliseCipher(Unknown Source)
    at org.bouncycastle.crypto.io.CipherInputStream.nextChunk(Unknown Source)
    at org.bouncycastle.crypto.io.CipherInputStream.read(Unknown Source)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.readFully(HashedBlockInputStream.java:171)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.load(HashedBlockInputStream.java:142)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.get(HashedBlockInputStream.java:100)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.read(HashedBlockInputStream.java:66)
    at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.skipString(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
    at com.intellij.util.JdomKt.loadDocument(jdom.kt:78)
    at com.intellij.util.JdomKt.loadElement(jdom.kt:73)
    at com.intellij.credentialStore.kdbx.KdbxKt.load(kdbx.kt:89)
    at com.intellij.credentialStore.kdbx.KdbxKt.access$load(kdbx.kt:1)
    at com.intellij.credentialStore.kdbx.KdbxStreamFormat.load(kdbx.kt:57)
    at com.intellij.credentialStore.kdbx.KdbxKt.loadKdbx(kdbx.kt:36)
    at com.intellij.credentialStore.KeePassCredentialStore.<init>(KeePassCredentialStore.kt:82)
    at com.intellij.credentialStore.KeePassCredentialStore.<init>(KeePassCredentialStore.kt:44)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImplKt.computeProvider(PasswordSafeImpl.kt:38)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImpl.<init>(PasswordSafeImpl.kt:46)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImpl.<init>(PasswordSafeImpl.kt)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:103)
    ... 62 more
Caused by: org.bouncycastle.crypto.InvalidCipherTextException: pad block corrupted
    at org.bouncycastle.crypto.paddings.PKCS7Padding.padCount(Unknown Source)
    at org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher.doFinal(Unknown Source)
    ... 103 more
Caused by:

org.bouncycastle.crypto.io.InvalidCipherTextIOException: Error finalising cipher
    at org.bouncycastle.crypto.io.CipherInputStream.finaliseCipher(Unknown Source)
    at org.bouncycastle.crypto.io.CipherInputStream.nextChunk(Unknown Source)
    at org.bouncycastle.crypto.io.CipherInputStream.read(Unknown Source)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.readFully(HashedBlockInputStream.java:171)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.load(HashedBlockInputStream.java:142)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.get(HashedBlockInputStream.java:100)
    at com.intellij.credentialStore.kdbx.HashedBlockInputStream.read(HashedBlockInputStream.java:66)
    at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:238)
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
    at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:117)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
    at org.apache.xerces.impl.XMLEntityScanner.skipString(Unknown Source)
    at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
    at com.intellij.util.JdomKt.loadDocument(jdom.kt:78)
    at com.intellij.util.JdomKt.loadElement(jdom.kt:73)
    at com.intellij.credentialStore.kdbx.KdbxKt.load(kdbx.kt:89)
    at com.intellij.credentialStore.kdbx.KdbxKt.access$load(kdbx.kt:1)
    at com.intellij.credentialStore.kdbx.KdbxStreamFormat.load(kdbx.kt:57)
    at com.intellij.credentialStore.kdbx.KdbxKt.loadKdbx(kdbx.kt:36)
    at com.intellij.credentialStore.KeePassCredentialStore.<init>(KeePassCredentialStore.kt:82)
    at com.intellij.credentialStore.KeePassCredentialStore.<init>(KeePassCredentialStore.kt:44)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImplKt.computeProvider(PasswordSafeImpl.kt:38)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImpl.<init>(PasswordSafeImpl.kt:46)
    at com.intellij.ide.passwordSafe.impl.PasswordSafeImpl.<init>(PasswordSafeImpl.kt)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:103)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:80)
    at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:63)
    at com.intellij.openapi.components.impl.ServiceManagerImpl$MyComponentAdapter.getComponentInstance(ServiceManagerImpl.java:220)
    at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:239)
    at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:206)
    at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:49)
    at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:39)
    at com.intellij.ide.passwordSafe.PasswordSafe.getInstance(PasswordSafe.java:28)
    at org.jetbrains.android.exportSignedPackage.KeystoreStep.retrievePassword(KeystoreStep.java:96)
    at org.jetbrains.android.exportSignedPackage.KeystoreStep.<init>(KeystoreStep.java:81)
    at org.jetbrains.android.exportSignedPackage.ExportSignedPackageWizard.<init>(ExportSignedPackageWizard.java:112)
    at org.jetbrains.android.actions.GenerateSignedApkAction.actionPerformed(GenerateSignedApkAction.java:74)
    at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:321)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:911)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:136)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:311)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:130)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
    at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120)
    at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:130)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:521)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:48)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:541)
    at java.awt.Component.processMouseEvent(Component.java:6541)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6306)
    at java.awt.Container.processEvent(Container.java:2237)
    at java.awt.Component.dispatchEventImpl(Component.java:4897)
    at java.awt.Container.dispatchEventImpl(Container.java:2295)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
    at java.awt.Container.dispatchEventImpl(Container.java:2281)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4719)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
    at java.awt.EventQueue.access$500(EventQueue.java:98)
    at java.awt.EventQueue$3.run(EventQueue.java:715)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
    at java.awt.EventQueue$4.run(EventQueue.java:737)
    at java.awt.EventQueue$4.run(EventQueue.java:735)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:646)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
    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)
Caused by: org.bouncycastle.crypto.InvalidCipherTextException: pad block corrupted
    at org.bouncycastle.crypto.paddings.PKCS7Padding.padCount(Unknown Source)
    at org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher.doFinal(Unknown Source)
    ... 103 more

插件 Android支持中的例外情况 自从我安装了新操作系统的新SSD驱动器后,我在签署应用程序方面没有任何问题。 我重新安装了JDK和Android Studio,并且在gradle构建之后我无法构建发布APK。我通过USB构建调试应用程序和调试应用程序没有问题。

有没有人遇到同样的问题?

3 个答案:

答案 0 :(得分:1)

只需转到您的用户文件夹(%USERPROFILE%),然后删除.android,.AndroidStudio以及最终版本的任何类似目录,即.AndroidStudio1.2,以及.gradle和.m2(如果存在)。

答案 1 :(得分:0)

因为我看到一个&#34; pad块已损坏&#34;消息,我想您无法恢复以前的工作区设置。我不仅要重新安装整个工作室,还要尝试使用新工作区并导入签名合同

答案 2 :(得分:0)

解决了

我也遇到过同样的问题。并成功解决了它。这是一步一步:

从Windows完全删除Android Studio:

第1步:运行Android Studio卸载程序

第一步是运行卸载程序。打开“控制面板”,在“程序”下,选择“卸载程序”。之后,点击&#34; Android Studio&#34; ,然后按卸载。如果您有多个版本,也可以卸载它们。

第2步:删除Android Studio文件

要删除任何Android Studio设置文件的剩余部分,请在文件资源管理器中转到您的用户文件夹(%USERPROFILE%),然后删除.android,.AndroidStudio以及任何类似的目录。结束,即。 AndroidStudio1.2 ,以及 .gradle .m2 (如果存在)。

然后转到%APPDATA%并删除JetBrains目录。

最后,转到 C:\ Program Files 并删除 Android目录

第3步:删除SDK

要删除SDK的剩余部分,请转到%LOCALAPPDATA%并删除 Android目录

第4步:删除Android Studio项目

Android Studio在%USERPROFILE%\ AndroidStudioProjects 文件夹中创建项目,您可能要将其删除。

完成所有这些过程后,您必须重新安装Android Studio。

***您必须清除与Android Studio相关的所有数据。

如果您遇到任何困难,请告诉我们:)