Android Studio无法完成项目构建且无错误提示
Been there, done that—silent Gradle failures are the worst, especially when everything worked fine before. Let's work through targeted fixes since your other projects run okay and your devices are in good shape:
Invalidate Caches & Restart Android Studio
This is my first go-to for weird build glitches. Head toFile > Invalidate Caches..., check all the boxes (Invalidate and Restart, plus Clear file system cache and local history), then hit "Invalidate and Restart". Corrupted cached build data often causes these silent crashes, so wiping it clean usually helps.Clean & Rebuild the Project Manually
Skip the one-click run for a minute—first doBuild > Clean Projectto wipe old artifacts, thenBuild > Rebuild Projectto force Gradle to generate everything from scratch. Partial builds can leave behind broken files that cause silent failures, so this full refresh might fix it.Double-Check Gradle Sync Status
Sometimes the project has an unresolved sync issue that doesn't pop up in the build log. Look at the top-right corner of Android Studio—if you see a "Sync Now" button, click it. If sync fails, it should show errors in the "Build" or "Gradle Console" tab that you might have missed earlier.Match Gradle Versions to a Working Project
Open your project's rootbuild.gradlefile and check the Gradle plugin version (thecom.android.tools.build:gradleline) and the Gradle wrapper version (ingradle/wrapper/gradle-wrapper.properties). Since your other projects work, copy the version numbers from a working project into this one, then sync again. Version mismatches can cause silent failures even if they don't throw obvious errors.Turn Off Instant Run
Instant Run is great when it works, but it can cause unexpected build behavior. Go toFile > Settings > Build, Execution, Deployment > Instant Runand uncheck "Enable Instant Run to hot swap code/resource changes on deploy". Restart Android Studio and try running your app again.Verify Your Local Properties
Open thelocal.propertiesfile in your project root—make sure thesdk.dirpath points correctly to your installed Android SDK. A wrong path here might cause Gradle to fail silently (even though it usually throws an error, it's worth a quick check).Delete the Gradle Wrapper Cache
Navigate to your project's hidden.gradlefolder and delete thewrappersubfolder. Then go toFile > Sync Project with Gradle Files—this will re-download the correct Gradle version and fix any corrupted wrapper files that might be causing the crash.
内容的提问来源于stack exchange,提问作者David Lancaster

