Actually, i did it. Finally. Here is how.
Step 1. Custom export templates are needed. So grab the most recent Godot version (stable, currently the 3.4 branch) from GIT.
Step 2. Edit the Android export settings to meet the target SDK.
a. In (...)/platform/android/export/export_plugin.cpp -> modify static const int DEFAULT_TARGET_SDK_VERSION = 30 to 32
b. In (...)/platform/android/java/app/AndroidManifest.xml -> Add android:exported="true" to the <activity tag
c. In (...)/platform/android/java/app/config.gradle -> Modify the following
- androidGradlePlugin to 7.1.2
- compileSdk to 32
- targetSdk to 32
- buildTools to 32.0.0
- kotlinVersion to 1.6.10
d. In (...)/platform/android/java/lib/AndroidManifest.xml Modify android:targetSdkVersion="30" to 32
Note: I tried to update the ndk as well but i got lots of errors upon compiling. So i returned to 21.4.7075529
Build the two templates according with the Godot documentation.
My choice was to replace the original android_debug.apk and android_release.apk in the export templates folder with the ones i made.
Additional note: If your game is using plugins therefore you had to use a custom build template, you will need to update manually that build (available in the res:android/build/ to use the above mentioned values. My choice was to import it in the Android Studio and edit the respective fields there then save. I've noticed that lots of Godot generated information were variables , I've replaced those with hard-coded values for the targetSDK and the rest
The plugins aar archive may also include an android manifest xml. Update the targetsdk for that one as well.
That's about how i did it. Note please that i am not a skilled developer, some things i've did may be actually useless or maybe they can be done easier in a smarter fashion. Hope it helps