[4.21.2] Android Packaging Error - IsGearVRApplication() is already defined in class GameActivity

Hey! I tried adding your code, but it wasn’t effective, I checked out more information about the bug.


> Task :app:compileDebugJavaWithJavac
Putting task artifact state for task ':app:compileDebugJavaWithJavac' into context took 0.0 secs.
file or directory 'Z:\app\libs', not found
file or directory 'Z:\app\src\main\libs', not found
file or directory 'Z:\app\src\debug\java', not found
Executing task ':app:compileDebugJavaWithJavac' (up-to-date check took 0.026 secs) due to:
Task has failed previously.
All input files are considered out-of-date for incremental task ':app:compileDebugJavaWithJavac'.
Compiling with source level 1.7 and target level 1.7.
file or directory 'Z:\app\libs', not found
file or directory 'Z:\app\src\main\libs', not found
Creating new cache for classAnalysis, path Z:\.gradle\4.1\javaCompile\classAnalysis.bin, access org.gradle.cache.internal.DefaultCacheAccess@115674e7
Creating new cache for jarAnalysis, path Z:\.gradle\4.1\javaCompile\jarAnalysis.bin, access org.gradle.cache.internal.DefaultCacheAccess@115674e7
Creating new cache for taskJars, path Z:\.gradle\4.1\javaCompile	askJars.bin, access org.gradle.cache.internal.DefaultCacheAccess@115674e7
Creating new cache for taskHistory, path Z:\.gradle\4.1\javaCompile	askHistory.bin, access org.gradle.cache.internal.DefaultCacheAccess@115674e7
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
file or directory 'Z:\app\src\debug\java', not found
Compiling with JDK Java compiler API.
Z:\app\src\main\java\com\epicgames\ue4\GameApplication.java:7: error: cannot find symbol
import android.arch.lifecycle.ProcessLifecycleOwner;
^
symbol: class ProcessLifecycleOwner
location: package android.arch.lifecycle
Z:\app\src\main\java\com\epicgames\ue4\GameApplication.java:22: error: cannot find symbol
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
^
symbol: variable ProcessLifecycleOwner
location: class GameApplication
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors

:app:compileDebugJavaWithJavac (Thread[Task worker for ':' Thread 4,5,main]) completed. Took 2.085 secs.

FAILURE: Build failed with an exception.




How can I fix it ?