發表文章

目前顯示的是 9月, 2021的文章

An exception occurred applying plugin request [id: 'com.android.application']

圖片
使用 Android Studio Arctic Fox | 2020.3.1 Patch 2 自 GitHub clone 回來的專案  build 時,遇上了以下問題 An exception occurred applying plugin request [id: 'com.android.application'] > Failed to apply plugin 'com.android.internal.application'.    > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.      You can try some of the following options:        - changing the IDE settings.        - changing the JAVA_HOME environment variable.        - changing `org.gradle.java.home` in `gradle.properties`.  使用第一行當關鍵字 google 到以下的 StackOverflow https://stackoverflow.com/questions/66376361/an-exception-occurred-applying-plugin-request-id-com-android-application-wh 照著文章,自 Android Studio 的選單中 選擇 [File] > [Project Structure...] 在 Project Structure 對話框左側選單,點選 [SDK Location] 右邊下方就會出現 JDK 的設定已移至 Gradle Settings  這時可直接點選 [Gradle Settings],就會出現 Gradle 對話框 依 StackOverflow 中的說明,將 Gradle JDK 改為 [Embedded JDK]  再次 build 就可成功了。 ⋯⋯ 另外,也可從 [Android Studio] > [Preferences..