I am running into issues setting up a project with Android. Forgive me, still getting my feet wet.
What I’ve tried so far,
The first issue was related to java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 which from a search looks like it is a gradle mismatch. I tried editing the gradle-wrapper.properties and rerunning gradlew, but this was clobbered by UE4 next time I tried to launch.
The next thing was, could I match the jdk to gradle? I looked up and the gradle version it was requesting was 6.1.1, which only supports JDK up to 13. So I installed that and couldn’t get it working.
And if it is the gradle version, how can that be changed? The only summary I found was at Manually Updating Gradle in Unreal Engine (draft) – Life Art Studios from just a few months ago - is this recently broken? The number of steps he had to go through can’t be the actual solution.
LogPlayLevel: > Task :app:compileDebugJavaWithJavac
LogPlayLevel: 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: Y:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:122: error: cannot find symbol
LogPlayLevel: webView.getSettings().setAppCacheMaxSize( 10 * 1024 * 1024 );
LogPlayLevel: ^
LogPlayLevel: symbol: method setAppCacheMaxSize(int)
LogPlayLevel: location: class WebSettings
LogPlayLevel: Error: Y:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:123: error: cannot find symbol
LogPlayLevel: webView.getSettings().setAppCachePath(GameActivity._activity.getApplicationContext().getCacheDir().getAbsolutePath() );
LogPlayLevel: ^
LogPlayLevel: symbol: method setAppCachePath(String)
LogPlayLevel: location: class WebSettings
LogPlayLevel: Error: Y:\app\src\main\java\com\epicgames\ue4\WebViewControl.java:125: error: cannot find symbol
LogPlayLevel: webView.getSettings().setAppCacheEnabled( true );
LogPlayLevel: ^
There are other issues as well. For example when I updated the android API to 30, it caused an issue where the SDK tools 33.0 were installed, which returns a different error when you try to compile.
What I did, was follow the steps in this stackoverflow
And during this process, keep checking Android Studio periodically. Android Studio or the UE4 batch file or gradle, one of these, was installing different versions of the tools or API. I particularly suspect that any time I added or removed an API version in the SDK Platforms it would change the SDK Tools panel as well.
Getting this running was like threading a needle on an orthogonal plane while the hole moves toward and away from you. You can’t see all the parts but something was messing it up in the backend.
Unreal Docs are total mess, non of the provided “guides” work. I wonder if they check what they write at all. I’m struggling with this android development setup for two weeks already. And it looks like Epic just doesn’t give a … I’m so tired of this.
the docs suck at explain
oculous ones are just as bad
the uat tool corrupted the ndk on me too
I found it best to do it by hand, the jre8 jdk 8 sdk 30 ndk 21
it is dumb
in Unity you press a button to agree and it builds the whole toolchain for you
AS4, the sdk ndk jdk jre.
There is a utuber GDXR who has a decent guide and a patreon.
But really, none of the tuts is really great and you have to bash about.