使用 Android Studio 构建简单的 android 应用程序时出现 java.security.NoSuchAlgorithmException [英] java.security.NoSuchAlgorithmException while building a simple android app using Android Studio

查看:50
本文介绍了使用 Android Studio 构建简单的 android 应用程序时出现 java.security.NoSuchAlgorithmException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 Android Studio 并尝试构建一个简单的登录活动.但 Make Project 失败并出现此错误.

I downloaded the Android Studio and trying to build a simple Login Activity. But the Make Project fails with this error.

Environment: Windows 7 64 bit

<小时>

摇篮:写入输出时遇到问题:java.security.NoSuchAlgorithmException:SHA-1 MessageDigest 不可用


Gradle: trouble writing output: java.security.NoSuchAlgorithmException: SHA-1 MessageDigest not available

FAILURE:构建失败,出现异常.

FAILURE: Build failed with an exception.

  • 出了什么问题:任务:MyApp:dexDebug"执行失败.

  • What went wrong: Execution failed for task ':MyApp:dexDebug'.

运行 C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat 失败.查看输出

Running C:\Program Files (x86)\Android\android-studio\sdk\build-tools\android-4.2.2\dx.bat failed. See output

试试:

使用 --stacktrace 选项运行以获取堆栈跟踪.使用 --info 或 --debug 选项运行以获得更多日志输出.

我已确保 Gradle zip 已正确下载并安装

I have made sure the Gradle zip was downloaded and installed properly

任何提示我还应该检查什么?

Any hints what else should I check for?

推荐答案

我使用的是 IBM JDK.切换到 Sun/Oracle JDK 解决了该问题.

I was using IBM JDK. Switching to Sun/Oracle JDK fixed the problem.

这篇关于使用 Android Studio 构建简单的 android 应用程序时出现 java.security.NoSuchAlgorithmException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆