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

Gradle构建报错:要求最低版本4.4,当前为4.3但Wrapper已设为4.4

Troubleshooting Gradle Version Mismatch (4.3 vs 4.4)

Hey there! Let's work through this frustrating Gradle version error you're hitting. You've already updated the Gradle Wrapper's distributionUrl and the Android Gradle Plugin classpath, but the build still complains about using 4.3 instead of 4.4. Here are some additional steps to fix this:

  • Check your global Gradle installation
    Sometimes your system's globally installed Gradle takes precedence over the project wrapper. Open a terminal and run gradle -v—if it outputs version 4.3, that's the culprit. Instead of using gradle build to run your build, always use the wrapper command: ./gradlew build (on macOS/Linux) or gradlew.bat build (on Windows). If you want to update your global Gradle, you can download version 4.4 manually and replace the old installation.

  • Wipe Gradle caches and build artifacts
    Stale cache files might be holding onto the old Gradle version reference. Do the following:

    1. Delete the .gradle folder in your project's root directory
    2. Delete the build folders in both your project root and all modules (like app/build)
    3. Run ./gradlew clean build --refresh-dependencies to force a clean build and refresh all dependencies
  • Verify Android Studio's Gradle settings
    If you're using Android Studio, make sure it's configured to use the project wrapper:

    1. Go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle
    2. Under "Use Gradle from", select "gradle-wrapper.properties file" (not a local Gradle installation)
    3. Also double-check that your Gradle JDK is set to Java 8—Gradle 4.4 requires Java 8 or newer, and an incompatible JDK can cause unexpected version issues
  • Regenerate the Gradle Wrapper files
    Your wrapper files might be corrupted. Run this command in your project root to regenerate them with the correct version:

    ./gradlew wrapper --gradle-version 4.4 --distribution-type all
    

    This will overwrite the existing wrapper configuration and ensure all related files point to Gradle 4.4.

  • Check your system PATH variable
    If your global Gradle's path is in your system's PATH environment variable, it might be overriding the wrapper. Temporarily remove the global Gradle path from PATH and try building again with the wrapper command to test if that fixes it.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 11:11:15