Skip to main content
Make title specific
Link
DMGregory
  • 136.3k
  • 22
  • 247
  • 373

Unity Mobile How to fix Gradle errors about API level, androd.enableR8, and how to fixresource linking failed?

Source Link

Unity Mobile Gradle errors and how to fix

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:

  1. In Google Play Console, "You cannot use API level 30 and below. For security reasons, your app should use API level 31+"
  2. In Unity, "android.enableR8 is deprecated"
  3. In Unity, unityLibrary:compileDebugJavaWithJavac
  4. In Unity, "Gradle Build Failed. Android resource linking failed... AAPT: error: attribute android:export not found"
  5. In Unity, "Gradle Build Failed. Android resource linking failed..."