You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio无法完成项目构建且无错误提示

Fixes for Gradle Build Abruptly Stopping Without Errors

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 to File > 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 do Build > Clean Project to wipe old artifacts, then Build > Rebuild Project to 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 root build.gradle file and check the Gradle plugin version (the com.android.tools.build:gradle line) and the Gradle wrapper version (in gradle/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 to File > Settings > Build, Execution, Deployment > Instant Run and 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 the local.properties file in your project root—make sure the sdk.dir path 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 .gradle folder and delete the wrapper subfolder. Then go to File > 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 09:41:17