Android dev with AGDE using VS 2022

Hello,

I’ve build a game using UE5 on Windows that uses BLE through WinRT, and for that I’ve transitioned to Visual Studio 2022, which knows how to correctly interpret WinRT code (vs previous versions).
I’ve ported the game on Android and I’m trying to use Visual Studio to debug why my game is not starting on the mobile device. I found that the new preferred way is using the Android Game Development Extension (AGDE) for VS. I’ve installed the latest AGDE version (that has VS 2022 support), but it requires JDK 11 or newer. If I change JDK version (point JAVA_HOME to another JDK than the default JDK 8 / 1.8.151), I get the “Could not initialize class org.codehaus.groovy.reflection.ReflectionCache” error - which happens if you don’t have JDK 8 (as I’ve read on this forum).

Do you have any solutions for debugging a UE5 project on Android from VS 2022?

Thank you!
Horia

Hey there, I am currently having the exact same problem, but with 4.27.
Did you ever find a solution?
I tried manually setting a jdb.exe location for the AGDE Debugger with a different Java environment variable, but it resulted in my Quest 2 not being recognized, so JAVA_HOME is likely being used by AGDE more extensively than this.

So far, JDK 11 (11.0.16.1 specifically) has been working. Build was successful, AGDE didn’t complain and recognized the Quest 2.

In between switching JAVA_HOME, it is important to delete the project’s Intermediate folder and right click the .uproject to Generate Visual Studio Files.
I tried just deleting Intermediate/Android/ and it didn’t work, so there must be more in the Intermediate folder that relies on Java_Home.
I imagine doing a full rebuild from editor would probably work similarly.

1 Like

This worked!

1 Like