Unreal Engine android packaging error

Hello, I’ve been working on Android development using Unreal Engine 4.27 for a few weeks now, but I keep seeing this error. No matter what I do, it doesn’t work. Can anyone help?

  • What went wrong:
    UATHelper: Packaging (Android (ASTC)): A problem occurred configuring root project ‘app’.
    UATHelper: Packaging (Android (ASTC)): > Could not resolve all artifacts for configuration ‘:classpath’.
    UATHelper: Packaging (Android (ASTC)): > Could not find com.android.tools.build:gradle:4.0.0.
    UATHelper: Packaging (Android (ASTC)): Searched in the following locations:
    UATHelper: Packaging (Android (ASTC)): - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.0/gradle-4.0.0.pom
    UATHelper: Packaging (Android (ASTC)): If the artifact you are trying to retrieve can be found in the repository but without metadata in ‘Maven POM’ format, you need to adjust the ‘metadataSources { … }’ of the repository declaration.
    UATHelper: Packaging (Android (ASTC)): Required by:
    UATHelper: Packaging (Android (ASTC)): project :
    UATHelper: Packaging (Android (ASTC)): * Try:
    UATHelper: Packaging (Android (ASTC)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    UATHelper: Packaging (Android (ASTC)): * Get more help at https://help.gradle.org
    UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 3s
    UATHelper: Packaging (Android (ASTC)): ERROR: cmd.exe failed with args /c “C:\Users\TS\Documents\Unreal Projects\AndroidTest05\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleDebug
    UATHelper: Packaging (Android (ASTC)): (see C:\Users\TS\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27\Log.txt for full exception trace)
    PackagingResults: Error: cmd.exe failed with args /c “C:\Users\TS\Documents\Unreal Projects\AndroidTest05\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleDebug
    UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
    UATHelper: Packaging (Android (ASTC)): BUILD FAILED
    PackagingResults: Error: Unknown Error