--- tags: AndroidStudio --- # Android Studio Dolphin 2021.3.1 專案編譯失敗 message: null ## Android Studio 版本資訊 ``` Android Studio Dolphin | 2021.3.1 Patch 1 Build #AI-213.7172.25.2113.9123335, built on September 30, 2022 Runtime version: 11.0.13+0-b1751.21-8125866 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 4096M Cores: 16 Registry: external.system.auto.import.disabled=true ide.text.editor.with.preview.show.floating.toolbar=false Non-Bundled Plugins: one.util.ideaplugin.screenshoter (1.8) org.intellij.plugins.markdown (213.6777.22) com.wzc.sw.plugin (1.3.1) com.duke.screenmatch (3.1) com.google.mad-scorecard (1.2) com.developerphil.adbidea (1.6.8) com.godwin.kdocer (1.6) ``` ## 問題說明 ![](https://i.imgur.com/066K9CE.png) Android Studio 更新至 2021.3.1 版本後,專案建置出現上面圖片呈現的問題。 無法編譯成功,而且錯誤訊息只有 null。 ### 已嘗試過的方式 1. Invalid cache and restart IDE 2. Update gradle versions ## 解決方式 查到的資料 [Dolphin: Project sync fails with "null" message](https://issuetracker.google.com/issues/247244491) 說 > Details: caused by unloaded sub-project. > In a project, add this to settings.gradle: include ':test' > Then unload it in Load/Unload Modules tool. > Try to Sync project, and you'll get null message and failure. > It seems that project unloading becomes useless with this bug present. :::info 查了一輪專案內的 module,發現其中一個項目 `chip-navigation-bar-dh-modified` 已經沒有引用但是沒有從專案內移除,因此將 `settings.gradle` 中的 `include ':chip-navigation-bar-dh-modified'` 移除再重新 sync 就解決了。 :::