Android package failed

After i updated Unreal engine to 5.3 (from 5.2.1) i keep getting package error

UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ====11/09/2023 00:55:57====PERFORMING FINAL APK PACKAGE OPERATION=====arm64===========================================
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\jniLibs\arm64-v8a\libUnreal.so.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\assets\main.obb.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\res\drawable\downloadimageh.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\res\drawable\icon.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\res\drawable-hdpi\icon.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\res\drawable-ldpi\icon.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\res\drawable-mdpi\icon.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\res\drawable-xhdpi\icon.png.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\java\com\epicgames\unreal\DownloadShim.java.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\java\com\UntitledProjectX\MyProject\AlarmReceiver.java.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\java\com\UntitledProjectX\MyProject\DownloaderActivity.java.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\java\com\UntitledProjectX\MyProject\OBBData.java.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Copied file D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\app\src\main\java\com\UntitledProjectX\MyProject\OBBDownloaderService.java.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Directory Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServer/../AFSStub copied to D:/Unreal Engine/Unreal Projects/MyProject - Copy/Intermediate/Android/arm64/gradle/AFSProject (True)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Directory Engine/Plugins/Runtime/AndroidFileServer/Source/AndroidFileServer/Android copied to D:/Unreal Engine/Unreal Projects/MyProject - Copy/Intermediate/Android/arm64/gradle/AFSProject/app/src/main (True)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Directory D:/Unreal Engine/Unreal Projects/MyProject - Copy/Intermediate/Android/arm64/gradle/app/src/main/res copied to D:/Unreal Engine/Unreal Projects/MyProject - Copy/Intermediate/Android/arm64/gradle/AFSProject/app/src/main/res (True)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Directory D:/Unreal Engine/Unreal Projects/MyProject - Copy/Intermediate/Android/arm64/gradle/gradle copied to D:/Unreal Engine/Unreal Projects/MyProject - Copy/Intermediate/Android/arm64/gradle/AFSProject/gradle (True)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Creating rungradle.bat to work around commandline length limit (using unused drive letter Z:)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Making .apk with Gradle...
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.5/userguide/gradle_daemon.html#sec:disabling_the_daemon.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Daemon will be stopped at the end of the build 
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * What went wrong:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): A problem occurred configuring root project 'app'.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Could not resolve all files for configuration ':classpath'.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):    > Could not resolve com.android.tools.build:gradle:7.4.2.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):      Required by:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):          project :
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):       > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):           - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Other compatible attribute:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):           - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Incompatible because this component declares documentation and the consumer needed a library
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Other compatible attributes:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about its target Java version (required compatibility with Java 8)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about its elements (required them packaged as a jar)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):           - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Other compatible attribute:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):           - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Incompatible because this component declares documentation and the consumer needed a library
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):               - Other compatible attributes:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about its target Java version (required compatibility with Java 8)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about its elements (required them packaged as a jar)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)):                   - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Try:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Run with --stacktrace option to get the stack trace.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Run with --info or --debug option to get more log output.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Run with --scan to get full insights.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED in 14s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): cmd.exe failed with args /c "D:\Unreal Engine\Unreal Projects\MyProject - Copy\Intermediate\Android\arm64\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): (see C:\Users\mojno\AppData\Roaming\Unreal Engine\AutomationTool\Logs\F+Unreal+Engine+Unreal+Engine+UE_5.3\Log.txt for full exception trace)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool executed for 0h 1m 11s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error

you’re using the wrong version of java.
make sure your sdk is properly installed and configured. i really don’t recommend mixing system wide java/android with ue one (though i can’ t remember if separating them is feasible).
unreal uses a very specific version of android studio.
and java. it has to be java 8

also make sure you open android studio and install the corresponding sdk and ndk (and dont update android studio)

these are my settings

UE5.3 and 5.4 uses Android Flamingo Version of the Java runtime (now jbr not jre)
How To Setup Android SDK