Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

java - Android Studio: Error:org.gradle.tooling.BuildException: Failed to generate v1 signature

The problem is arising in Android Studio 3.0.

When I create a new project, everything works fine but after sometime, the error

Error:org.gradle.tooling.BuildException: Failed to generate v1 signature

Starts to appear automatically which causes the gradle to fail.

When I run it with --stacktrace, here's what it shows me:

Information:Gradle tasks [:app:assembleDebug]

Error:org.gradle.tooling.BuildException: Failed to generate v1 signature

Error:java.io.IOException: Failed to generate v1 signature

Error:java.security.InvalidKeyException: Failed to sign using signer "CERT"

Error:java.security.InvalidKeyException: Failed to sign using SHA1withDSA

Error:java.security.InvalidKeyException: The security strength of SHA-1 digest algorithm is not sufficient for this key size

Information:BUILD FAILED in 1s

5 errors 0 warnings

Here is the full Gist of the Gradle console Gist

I am using Windows 10 X64 with JDK 8 X64.

Any help to solve this problem will be greatly appreciated!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found I was able to fix this issue by using the following command line to build a new key file, as desribed at https://developer.android.com/studio/publish/app-signing.html:

keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias

Specifically, I believe the problem is that the default has changed from RSA to DSA at some point, and the tools don't work correctly with large DSA keys.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...