When I try to launch a Vr project from Unreal Engine 4.7 to my Oculus Quest 2 I the following error:
The following annotation processors are not incremental: lifecycle-compiler-2.0.0.jar (androidx.lifecycle:lifecycle-compiler:2.0.0).
LogPlayLevel: Make sure all annotation processors are incremental to improve your build speed.
LogPlayLevel: Error: Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:556: error: variable PackagedForOculusMobile is already defined in class GameActivity
LogPlayLevel: public boolean PackagedForOculusMobile = false;
LogPlayLevel: ^
LogPlayLevel: Error: Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:559: error: method AndroidThunkJava_IsOculusMobileApplication() is already defined in class GameActivity
LogPlayLevel: public boolean AndroidThunkJava_IsOculusMobileApplication()
LogPlayLevel: ^
LogPlayLevel: Error: Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:2840: error: variable hasVR is already defined in method onCreate(Bundle)
LogPlayLevel: boolean hasVR = false;
LogPlayLevel: ^
LogPlayLevel: Error: Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:2842: error: variable vrIntent is already defined in method onCreate(Bundle)
LogPlayLevel: Intent vrIntent = new Intent(Intent.ACTION_MAIN, null);
LogPlayLevel: ^
LogPlayLevel: Error: Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:2847: error: variable pkgManager is already defined in method onCreate(Bundle)
LogPlayLevel: PackageManager pkgManager = getApplicationContext().getPackageManager();
LogPlayLevel: ^
LogPlayLevel: Error: Z:\app\src\main\java\com\epicgames\ue4\GameActivity.java:3241: error: cannot find symbol
LogPlayLevel: powerManager.addThermalStatusListener(getMainExecutor(), new PowerManager.OnThermalStatusChangedListener() {
LogPlayLevel: ^
LogPlayLevel: symbol: class OnThermalStatusChangedListener
LogPlayLevel: location: class PowerManager
LogPlayLevel: Note: Some input files use or override a deprecated API.
LogPlayLevel: Note: Recompile with -Xlint:deprecation for details.
LogPlayLevel: 6 errors
LogPlayLevel: > Task :app:compileDebugJavaWithJavac FAILED
LogPlayLevel: FAILURE: Build failed with an exception.
LogPlayLevel: * What went wrong:
LogPlayLevel: Execution failed for task ':app:compileDebugJavaWithJavac'.
LogPlayLevel: > Compilation failed; see the compiler error output for details.
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 21s
LogPlayLevel: 32 actionable tasks: 3 executed, 29 up-to-date
LogPlayLevel: Error: ERROR: cmd.exe failed with args /c "D:\Dokumente\Unreal Projects\VR2\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
LogPlayLevel: (see C:\Users\...\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27\Log.txt for full exception trace)
LogPlayLevel: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 33.269529
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error
I use Java Version 8 right now but I also tried other versions. For example when I use Version 15 I get the error "Could not initialize class org.codehaus.groovy.reflection.ReflectionCache". I also tried it with different versions of the SDK, but nothing seems to work.