Pack to Android From Mac: Error (could not determine java version from 13.0.1)

Hi all,
Usually i work on windows but right now i am on a mac and i am quite unfamiliar with the system.
Basically i got some hard times downloading the right “JDK” ?
On windows the CodeWorks in the unreal folder , download for me the NVpack that contain the SDK, NDK, and the JDK.
On mac this does not happens , and in the NVpack there is no JDK folder.
I downloaded some on internet and got 2 result.
The first folder Lead me to the error “Could not find JAVA-HOME” or something like that.
With this new JDK i downloaded i get this error…

So, I have to download another CodeWorks that contain the perfect JDK???
Where i can download the right JDK for my unreal?
This is the last error i get

Thank you




UATHelper: Packaging (Android (ETC1)): Making .apk with Gradle...
UATHelper: Packaging (Android (ETC1)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ETC1)): * What went wrong:
UATHelper: Packaging (Android (ETC1)): Could not determine java version from '13.0.1'.
UATHelper: Packaging (Android (ETC1)): * Try:
UATHelper: Packaging (Android (ETC1)): 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 (ETC1)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ETC1)): ERROR: /bin/sh failed with args -c '"/Users/Sabina/Documents/Unreal Projects/NEW_CLEAN/Intermediate/Android/APK/gradle/gradlew" :app:assembleDebug'
UATHelper: Packaging (Android (ETC1)):        (see /Users/Sabina/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
PackagingResults: Error: /bin/sh failed with args -c '"/Users/Sabina/Documents/Unreal Projects/NEW_CLEAN/Intermediate/Android/APK/gradle/gradlew" :app:assembleDebug'
UATHelper: Packaging (Android (ETC1)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ETC1)): RunUAT ERROR: AutomationTool was unable to run successfully.
PackagingResults: Error: AutomationTool was unable to run successfully.
PackagingResults: Error: Unknown Error
 

Hello Est_engine,

Wha happens when you type ‘javac’ in you terminal? Is the JAVA_HOME environment variable correctly set and are the Java binaries added to your PATH environment variable?

Cheers!

Hi Est_engine,

Are you able to resolve the issue and package to Android yet?
I m new to Mac too, and I m running in to the same problem as you did.

I have installed the JDK from here and tried to follow these guides to set up the JAVA_HOME and PATH environment variable:
https://stackoverflow.com/questions/…ac-permanently

Now I have these in my .bash_profile and .zhrc:



export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-13.0.2.jdk/Contents/Home"

export PATH=$JAVA_HOME/bin:$PATH


After all, whenever I used: “source .bash_profile” or .zhrc ., “echo $JAVA_HOME” will returns the path I specified.

Back in UE4, it still returns the same error.

Please let me know if you have resolved the issue, and how you did it. It would be greatly appreciated.
Any tips, links, or guides on this would be great too, as I am finding it hard to pin down the problem.

Update:

Turns out my JDK version is too high for UE4’s version of Gradle.
After downgrading my JDK to JDK 8 instead of 11 (and re-configure the JAVA-HOME path), everything works fine.

I have the same problem… but When I try to follow your steps I dont have good result.

UATHelper: Packaging (Android (ETC1)): ERROR: /bin/sh failed with args -c ‘"/Users/walterleonardo/Documents/Unreal Projects/RUNNERS/Intermediate/Android/APK/gradle/gradlew" :app:assembleDebug’
UATHelper: Packaging (Android (ETC1)): (see /Users/walterleonardo/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
UATHelper: Packaging (Android (ETC1)): AutomationTool exiting with ExitCode=1 (Error_Unknown)

I has the Gradle 6.3. into the system, but the UE4 use a old version, where I can change this version?