Native mobile app builder fails

I upgraded a Mendix app from 8.18.16 to 9.24.5 and tried to build a native Android app. I also selected a new GitHub repository and upgraded the native template to 7.0.5. The build fails while it worked fine in version 8.   Below a snapshot of the log file: 2023-08-25T10:51:27.5314640Z Project nativeTemplate at : is either no Android app project or build version has not been set to override. Skipping... 2023-08-25T10:51:28.3342450Z  2023-08-25T10:51:28.3359390Z > Configure project :app 2023-08-25T10:51:28.3366420Z Project app at :app is either no Android app project or build version has not been set to override. Skipping... 2023-08-25T10:51:28.3366810Z  2023-08-25T10:51:28.3367240Z FAILURE: Build failed with an exception. 2023-08-25T10:51:28.3367560Z  2023-08-25T10:51:28.3367900Z * Where: 2023-08-25T10:51:28.3368620Z Build file '/Users/runner/work/1/s/android/app/build.gradle' line: 1 2023-08-25T10:51:28.3368950Z  2023-08-25T10:51:28.3369330Z * What went wrong: 2023-08-25T10:51:28.3369890Z A problem occurred evaluating project ':app'. 2023-08-25T10:51:28.3370540Z > Failed to apply plugin ''. 2023-08-25T10:51:28.3371040Z    > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. 2023-08-25T10:51:28.3371720Z      Your current JDK is located in  /Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.382-5/x64/Contents/Home/jre 2023-08-25T10:51:28.3372240Z      You can try some of the following options: 2023-08-25T10:51:28.3372780Z        - changing the IDE settings. 2023-08-25T10:51:28.3373350Z        - changing the JAVA_HOME environment variable. 2023-08-25T10:51:28.3380670Z        - changing `` in ``. 2023-08-25T10:51:28.3387100Z  2023-08-25T10:51:28.3404550Z * Try: 2023-08-25T10:51:28.3462440Z > Run with --stacktrace option to get the stack trace. 2023-08-25T10:51:28.3470130Z > Run with --info or --debug option to get more log output. 2023-08-25T10:51:28.3493570Z > Run with --scan to get full insights. 2023-08-25T10:51:28.3493990Z  2023-08-25T10:51:28.3551940Z * Get more help at 2023-08-25T10:51:28.3552480Z  2023-08-25T10:51:28.3552950Z BUILD FAILED in 1m 14s 2023-08-25T10:51:29.4393660Z Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1 2023-08-25T10:51:29.4437780Z     at ChildProcess.<anonymous> (/Users/runner/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/1.128.0/node_modules/vsts-task-lib/toolrunner.js:569:30) 2023-08-25T10:51:29.4475980Z     at emitTwo (events.js:106:13) 2023-08-25T10:51:29.4495640Z     at ChildProcess.emit (events.js:191:7) 2023-08-25T10:51:29.4511850Z     at maybeClose (internal/child_process.js:920:16) 2023-08-25T10:51:29.4539510Z     at Socket.<anonymous> (internal/child_process.js:351:11) 2023-08-25T10:51:29.4568370Z     at emitOne (events.js:96:13) 2023-08-25T10:51:29.4603880Z     at Socket.emit (events.js:188:7) 2023-08-25T10:51:29.4626950Z     at Pipe._handle.close [as _onclose] (net.js:509:12) 2023-08-25T10:51:29.4862380Z ##[error]Error: /Users/runner/work/1/s/android/gradlew failed with return code: 1 2023-08-25T10:51:29.4917550Z ##[section]Finishing: Gradle Task    
1 answers

The log message says you need java 11 for the build to complete. Looks like you have the older version 1.8 installed. 


In case you are using App Center for your build: set the JAVA_HOME environment variable to $(JAVA_HOME_11_X64)