Android build failed

I can’t build my unreal egine game for android. I tried to solve the problem for 2 weeks, but no luck. When i try to build my project for android, i get this error continiously.

UATHelper: Packaging (Android (ETC2)): The following annotation processors are not incremental: lifecycle-compiler-2.0.0.jar (androidx.lifecycle:lifecycle-compiler:2.0.0).
UATHelper: Packaging (Android (ETC2)): Make sure all annotation processors are incremental to improve your build speed.
UATHelper: Packaging (Android (ETC2)): Z:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:122: error: cannot find symbol
UATHelper: Packaging (Android (ETC2)):                 webView.getSettings().setAppCacheMaxSize( 10 * 1024 * 1024 );
UATHelper: Packaging (Android (ETC2)):                                      ^
UATHelper: Packaging (Android (ETC2)):   symbol:   method setAppCacheMaxSize(int)
UATHelper: Packaging (Android (ETC2)):   location: class WebSettings
UATHelper: Packaging (Android (ETC2)): Z:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:123: error: cannot find symbol
UATHelper: Packaging (Android (ETC2)):                 webView.getSettings().setAppCachePath(GameActivity._activity.getApplicationContext().getCacheDir().getAbsolutePath() );
UATHelper: Packaging (Android (ETC2)):                                      ^
UATHelper: Packaging (Android (ETC2)):   symbol:   method setAppCachePath(String)
UATHelper: Packaging (Android (ETC2)):   location: class WebSettings
UATHelper: Packaging (Android (ETC2)): Z:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:125: error: cannot find symbol
UATHelper: Packaging (Android (ETC2)):                 webView.getSettings().setAppCacheEnabled( true );
UATHelper: Packaging (Android (ETC2)):                                      ^
UATHelper: Packaging (Android (ETC2)):   symbol:   method setAppCacheEnabled(boolean)
UATHelper: Packaging (Android (ETC2)):   location: class WebSettings
PackagingResults: Error: cannot find symbol
PackagingResults: Error: cannot find symbol
PackagingResults: Error: cannot find symbol
UATHelper: Packaging (Android (ETC2)): Note: Some input files use or override a deprecated API.
UATHelper: Packaging (Android (ETC2)): Note: Recompile with -Xlint:deprecation for details.
UATHelper: Packaging (Android (ETC2)): 3 errors
UATHelper: Packaging (Android (ETC2)): > Task :app:compileDebugJavaWithJavac FAILED
UATHelper: Packaging (Android (ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ETC2)): * What went wrong:
UATHelper: Packaging (Android (ETC2)): Execution failed for task ':app:compileDebugJavaWithJavac'.
UATHelper: Packaging (Android (ETC2)): > Compilation failed; see the compiler error output for details.
UATHelper: Packaging (Android (ETC2)): * Try:
UATHelper: Packaging (Android (ETC2)): 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.
UATHelper: Packaging (Android (ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ETC2)): BUILD FAILED in 2m 27s
UATHelper: Packaging (Android (ETC2)): 32 actionable tasks: 2 executed, 30 up-to-date
UATHelper: Packaging (Android (ETC2)): ERROR: cmd.exe failed with args /c "C:\Users\Admin\Documents\Unreal Projects\et\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (ETC2)):        (see C:\Users\Admin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.27\Log.txt for full exception trace)
PackagingResults: Error: cmd.exe failed with args /c "C:\Users\Admin\Documents\Unreal Projects\et\Intermediate\Android\armv7\gradle\rungradle.bat" :app:assembleDebug
UATHelper: Packaging (Android (ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error
LogSlate: Window 'Output Log' being destroyed
LogSlate: Window 'Output Log' being destroyed

i tried the possible solutions on the internet but no luck
-changing between different cmake versions and nkd versons
-installing sdk 29
-editing gradle.properties in project files
-deleting intermidate folder
-deleting .gradle in user folder
-disabling Oculus plugin
-setting environmetal variable for java
-installing different jdk and jre version even to the lowest one
-installing visual studio

Please help

This topic has been moved from International to Platform & Builds: Mobile.

When posting, please review the categories to ensure your topic is posted in the most relevant space. Hopefully, this category change will help to get an answer.

In the meantime, good luck and happy developing! :slight_smile:

what version of unreal are you using?

is hard to understand what is going on but you are probably trying to build from unreal using unsupported SDKs or some options in the project got messed up.

try first to build a project that is not modified. create a new project from a template. try to build it. see if it works

you need exactly:
JDK 8 or open jdk 8
jre 8
ndk 21
SDK 29/30
I suspect you do not have the jre 8 and jdk 8 installed.

I solved issue in unreal egine 4.27

by downloading unreal egine 4.24 and installed nvpack with default packages. Then i installed Android studio and configured the installation location to
C:\NVPACK\android-sdk-windows

after that i installed sdk 28,29,30 and NDK version 21.1.6352462 ( you can find them by checking Show pakage detail on the bottom)using android studio SDk manager.

then I went to NVPACK folder and i setuped like this

If android-ndk version is not the same, goto Download NDK r12.b and download then put in the NVPACK folder like the above screenshot.

Then i went to unreal engine 4.27 > open my project> i disabled oculus plugin>restart the editor.
the i went to Project setting>android SDK and
for SDk, i set to

C:/NVPACK/android-sdk-windows

for NDK, path

C:/NVPACK/android-sdk-windows/ndk/21.1.6352462

and for, jdk

C:/NVPACK/jdk1.8.0_77

i set sdk api level to 30 and ndk 29(cause ndk version 21.1.6352462 have platform upto 29 only)

and in Project setting>android i set the minimum sdk and target sdk to 29(you can change this to lower but first install the crossponding SDK platform versions using android studio)

and finally, it workes.