1. 环境
- Android Studio 3.5.2;
- Build #AI-191.8026.42.35.5977832, built on October 31, 2019;
- JRE: 1.8.0_202-release-1483-b03 amd64;
- JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o;
- Windows 10 10.0;
2. 问题
- Android Studio 和 Gradle 使用不同位置 JDK;
-- 报错:
Android Studio is using this JDK location: // C:\Program Files\Android\Android Studio\jre which is different to what Gradle uses by default: // E:\Java\jdk1.8.0_251 // Using different locations may spawn multiple Gradle daemons if // Gradle tasks are run from command line while using Android Studio. // // More info... // Set Android Studio to use the same JDK as Gradle and sync project // Do not show this warning again (39 minutes ago)
-- 如下图:
image.png
3. 解决
- 依次点击:File -> Project Structure,在弹窗依次点击 SDK Location;
- 在 JDK Location: 输入框后的 ... 按钮,如下图:
image.png - 找到系统环境变量设置的 jdk 路径并导入;
-
点击允许网络通讯;
wangluotong -
等待几分钟后,得到下图,问题解决;
image.png
网友评论