I encountered several errors when building on Unity 2021 for Android Platform. They're all part of the same "error group" so I'll list all of them down here since they're all part of a single problem which is exporting a game for Android. I can't find a single solution since everything I'm listing is part of my solution.
Here are some of the errors I've encountered:
- In Google Play Console, "You cannot use API level 30 and below. For security reasons, your app should use API level 31+"
- In Unity, "android.enableR8 is deprecated"
- In Unity, unityLibrary:compileDebugJavaWithJavac
- In Unity, "Gradle Build Failed. Android resource linking failed... AAPT: error: attribute android:export not found"
- In Unity, "Gradle Build Failed. Android resource linking failed..."