I'm having trouble with packaging my project for Android.As soon as I start packaging an error occurs and it can't continue. The error is this:
PackagingResults: Error: Command E:\Program Files\Epic Games\UE_5.2\Engine\Extras\Android\SetupAndroid.bat android-32 30.0.3 3.10.2.4988404 25.1.8937393 -noninteractive failed [Exit code 4, working dir = E:\Program Files\Epic Games\UE_5.2\Engine\Extras\Android]
More info from Output Log
You can see in the image that Output Log says that it Failed to install Android SDK r25b.. but in Unreal Engine Documentaion -> Android -> Development Requirements it says that the NDK (not SDK) needs to be r25b..so I'm confused
I installed the latest Android Studio on its default location
After that I read Unreal Documentation on how to set up android SDK and NDK and I tried to run packaging and had a bunch of errors that I can't really remember. And this same error I have now was between all of the others. The errors were there because I didn't set up the SDK Tools properly.So I started following this video:
https://www.youtube.com/watch?v=jMkl5FdtvP8&list=PLd_lmWO1xgx0LBJO3z2ELjW9jHorXf897&index=103
After installing and setting up all of the SDK,NDK and JDK files (In Android Studio and after in Unreal Engine) it started to pack. Even this "-noninteractive failed" error was not there. But when it cooked up everything in the end I had this error message that resulted in package failure:
Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
Then I found this youtube video: https://www.youtube.com/watch?v=OAYEpiTgeXI&list=PLd_lmWO1xgx0LBJO3z2ELjW9jHorXf897&index=104
It basically helped me understand that I was missing JRE files and that I shouldn't set the location of JAVA on JDK location but on JRE location:
But I followed setting up everything in this video, even the setting up SDK and NDK Tools (Android Studio Setup part of that video)... which was clearly a mistake because after that it didn't even register the android platform as it should (It had a triangle warning sign next to it).I've managed to get back most of the settings that made it start packing before tinkering with the SDK Tools again..the emphasys on most..
So now I am back with this error that I don't know how was fixed in the first place. And when I go to SetupAndroid.bat file in the engine root, open it with Notepad++ and search for -noninteractive in order to try and see the code for google exploring about it I get only this:
IF "%5" == "-noninteractive" (
set PAUSE=
) ELSE (
set PAUSE=pause
)
When I try and google the error I've posted here it leads me to setting up SDK's..But some of the SDK's were set up automatically when I followed the first video from Alex Pearce and I can't remember how it was set up before following the video from Nils Gallist. These are the settings that I have now in Android Studio:
-SDK Build Tools: SKD Build Tools -NDK: NDK -Command-line Tools and CMake: Command-line Tools and CMake
So if anyone has a solution for this it would be a lifesaver