Build Android Gradle problem

Hi people please HELP with this one,

Basically, I’m getting an error below when trying to test a game on Android :

LogPlayLevel: Making .apk with Gradle…
LogPlayLevel: To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: The Gradle Daemon.
LogPlayLevel: Daemon will be stopped at the end of the build stopping after processing
LogPlayLevel: FAILURE: Build failed with an exception.
LogPlayLevel: * Where:
LogPlayLevel: Settings file ‘/Users/lukaskrikstaponis/Documents/Unreal Projects/MyProject/Intermediate/Android/arm64/gradle/settings.gradle’ line: 9
LogPlayLevel: * What went wrong:
LogPlayLevel: A problem occurred evaluating settings ‘app’.
LogPlayLevel: > AFSProject/gradle.properties (No such file or directory)
LogPlayLevel: * Try:
LogPlayLevel: 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.
LogPlayLevel: * Get more help at https://help.gradle.org
LogPlayLevel: BUILD FAILED in 1s
LogPlayLevel: Error: ERROR: /bin/sh failed with args -c “”/Users/lukaskrikstaponis/Documents/Unreal Projects/MyProject/Intermediate/Android/arm64/gradle/gradlew" :app:assembleDebug"
LogPlayLevel: (see /Users/lukaskrikstaponis/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
LogPlayLevel: AutomationTool executed for 0h 0m 45s
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 12.691273
LogPlayLevel: Error: RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 1
PackagingResults: Error: Launch failed! Unknown Error

I just encountered a similar issue.

LogPlayLevel: FAILURE: Build failed with an exception.
LogPlayLevel: * Where:
LogPlayLevel: Settings file '/Users/andreivictor/Work/Unreal Projects/AR_Test/Intermediate/Android/arm64/gradle/settings.gradle' line: 9
LogPlayLevel: * What went wrong:
LogPlayLevel: A problem occurred evaluating settings 'app'.
LogPlayLevel: > AFSProject/gradle.properties (No such file or directory)
LogPlayLevel: * Try:
LogPlayLevel: 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.
LogPlayLevel: * Get more help at https://help.gradle.org
LogPlayLevel: BUILD FAILED in 24s
LogPlayLevel: Error: ERROR: /bin/sh failed with args -c "\"/Users/andreivictor/Work/Unreal Projects/AR_Test/Intermediate/Android/arm64/gradle/gradlew\" :app:assembleDebug"
LogPlayLevel:        (see /Users/andreivictor/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
LogPlayLevel: AutomationTool executed for 0h 1m 30s
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 28.132378
LogPlayLevel: Error: RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 1
PackagingResults: Error: Launch failed! Unknown Error

Try deleting the Android folder in [Your project]/Intermediate
then rebuild.

1 Like

I did try, but it resulted the same error.

I think the problem is the current directory that gradle is in. I added a
System.out.println(afs_outfile.getAbsolutePath())
in my settings.gradle and the output was /Users/andreivictor/.gradle/daemon/6.1.1/AFSProject/gradle.properties, which is clearly wrong.

So what I did to fix this problem is to:

  1. Open settings.gradle
  2. Find new File( and replace with new File(rootProject.projectDir, (Mine had 8 occurrences.)
  3. Rebuild.
1 Like