I want to make separate APKs for OpenGLES2 devices (with lower quality settings) and for all other devices (with better quality, for ex. AA x2)
I have built APK with Graphics APIs forced to OpenGLES3 and Vulkan only, but when I uploaded this APK to Google Play Console it says: OpenGL ES versions: 2.0+
Also it gives an error that OpenGLES2 apk is “Fully shadowed” by OpenGLES3 apk, so this OpenGLES3 version will be installed on OpenGLES2 devices.
The apks with Graphics API forced to OpenGLES3 are backward compatible with OpenGLES2 and so unity sets minimum graphics api to 2.0 in android manifest. Seems like there is no option in unity to change this behavior. But you can use custom manifest or change minimum graphics api version using custom gradle file:
Select gradle build system in Build Settings
Check “Custom Gradle Template” in “Player Settings → Publishing Settings”.
Append following code to the end of generated gradle file: <pre> android.applicationVariants.all { variant -> variant.outputs.each { output -> output.processManifest.doLast { //String manifestPath = "$manifestOutputDirectory/AndroidManifest.xml" //def manifestContent = file(manifestPath).getText() String manifestPath = manifestOutputFile def manifestContent = file(manifestPath).getText() manifestContent = manifestContent.replace('android:glEsVersion="0x00020000"', 'android:glEsVersion="0x00030000"') file(manifestPath).write(manifestContent) } } } </pre>
The commented code is for gradle android plugin v.3.0+, but I didn’t check it.
You can see manifest of apk before uploading to Google Play Console with aapt tool from Android SDK: