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

Android Studio 3.1运行指令不重建APK问题求助

Fix for "Error Installing APK" & Missing Auto-Rebuild After Android Studio 3.1 Upgrade

Hey there, I totally get how frustrating this is—having to manually hit "rebuild & run" every time after a code change is such a workflow killer. I dealt with this exact issue when I upgraded to AS 3.1, so here are some fixes that worked for me and other developers:

  • Invalidate Caches & Restart
    This is the classic fix for wonky IDE behavior. Navigate to File > Invalidate Caches..., tick all the cache options, then click "Invalidate and Restart". This clears out any corrupted cached build data that might be blocking the auto-rebuild.

  • Verify Gradle & Plugin Settings
    Double-check your build configuration to make sure nothing got messed up during the upgrade:

    • Open your project’s gradle.properties file and confirm android.enableBuildCache=true is present (it’s enabled by default in AS 3.1, but sometimes gets reset)
    • Ensure your module-level build.gradle uses the compatible Gradle plugin version: com.android.tools.build:gradle:3.1.0 (or the latest patch for 3.1.x)
  • Turn Off Instant Run
    Instant Run can clash with the new build system after upgrades. Go to File > Settings > Build, Execution, Deployment > Instant Run and uncheck the box for "Enable Instant Run to hot swap code/resource changes on deploy". Restart AS and try running your app again—this often fixes the auto-rebuild issue.

  • Do a Full Clean + Rebuild
    Even though you’re doing this manually now, a one-time full clean might reset the build state:

    1. Run Build > Clean Project
    2. Follow it with Build > Rebuild Project
    3. Try running the app normally afterward—this sometimes jumpstarts the auto-rebuild process again.
  • Check Device Deployment Settings
    Sometimes the error isn’t about building the APK, but installing it:

    • Make sure your device has USB debugging enabled and is properly detected by AS
    • Confirm there’s enough storage space on the device for the APK
    • On physical devices, ensure "Install unknown apps" is allowed for your computer’s connection

内容的提问来源于stack exchange,提问作者Marcos DaSilva

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.21 04:17:26