Packaging for Android always fails

Hey everyone,

I absolutely do not know how to successfully package/build for android. I feel like the SDK and NDK versions to choose are absolutely random but none of them seem to work for me.

What I did:

I fully removed both Java and anything related to Android Studio. I am running on a fresh UE 4.27.2 with a project that has only a few BP-assets and some CPP classes made from the blank template no starter content.
I installed the JDK 1.8.0_77 so I have the same jre as my Java (shown in images).
grafik
I chose this one cause people used it and it seems to work for them.

I then installed Android Studio 4.0 (the one with no Beta or Alpha or whatever) from the documentation. I then Installed the NDK from documentation for 4.27 (NDK21b I think) and selected Android API 31 and selected thise SDK’s for 31 too! I even tried others, 28, 29, 32, eve 34 and none of them seem to work. My current error when building looks like the following:


and ends like

I’ve watched many tutorials online and none of them do work for me. If someone can explain step by step how to properly do this I would be thankful. But at this point I kinda doubt it’ll work for me…

Also I do not know why I got these warnings…



I never ever had these in my project since I started on a blank project.

Thank you already for trying to help me!!!

Here is some additional info if it helps.
grafik




I did try a lot so in case you’d recommend to use a different NDK or SDK I probably already tried with no success.

After more than 2 days of trying I finally managed to build successfully…
grafik

Problem is I do not even know why it worked this time.
These are my settings (SDK 30.0.3 being the latest):
grafik

Is there any logic behind what combination of JDK, SDK and NDK works or is it just trial and error?