Essential Kit Tutorials
DocumentationDownload
Version 2
Version 2
  • Introduction
  • Features
  • Version 2 vs Version 1
  • Release Notes
    • ✅Version 2.7.4
    • Version 2.7.3
    • Version 2.7.2
    • Version 2.7.1
    • Version 2.7.0
    • Older Versions
      • Version 2.6.1
      • Version 2.6.0
      • Version 2.5.1
      • Version 2.5.0
      • Version 2.4.1
      • Version 2.4.0
      • Version 2.3.1
      • Version 2.3.0
      • Version 2.2.1
      • Version 2.2.0
      • Version 2.1.1
      • Version 2.1.0
      • Version 2.0.4
      • Version 2.0.3
      • Version 2.0.2
      • Version 2.0.1
      • Version 2.0.0
  • Plugin Overview
    • Settings
    • Folder Structure
    • Installation FAQ
    • Localisation
  • Address Book
    • Overview
    • Use Cases
    • Setup
    • Usage
    • Testing
    • FAQ
  • Billing Services
    • Overview
    • Use Cases
    • Setup
      • iOS
      • Android
    • Usage
    • Testing
      • iOS
      • Android
    • FAQ
  • Cloud Services
    • Overview
    • Use Cases
    • Setup
      • iOS
      • Android
    • Usage
    • Testing
    • FAQ
  • Deep Link Services
    • Overview
    • Use Cases
    • Setup
      • iOS
      • Android
    • Usage
    • Testing
    • FAQ
  • Extras (Utilities)
    • Overview
    • Usage
  • Game Services
    • Overview
    • Use Cases
    • Setup
      • iOS
      • Android
    • Usage
    • FAQ
  • Media Services
    • Overview
    • Use Cases
    • Setup
    • Usage
    • FAQ
  • Native UI
    • Overview
    • Use Cases
    • Setup
    • Usage
    • FAQ
  • Network Services
    • Overview
    • Use Cases
    • Setup
    • Usage
    • FAQ
  • Notification Services
    • Overview
    • Use Cases
    • Setup
      • iOS
      • Android
    • Usage
    • FAQ
  • Rate My App
    • Overview
    • Use Cases
    • Setup
    • Usage
    • FAQ
  • Sharing
    • Overview
    • Use Cases
    • Setup
    • Usage
      • Message Composer
      • Mail Composer
      • Social Share Composer
      • Share Sheet
    • FAQ
  • Web View
    • Overview
    • Use Cases
    • Setup
    • Usage
    • FAQ
  • Notes
    • Resolving Android Gradle Build Errors
    • Google Play Services Authentication
Powered by GitBook
On this page
  • How to resolve "AAPT: error: unexpected element <queries> found in <manifest>" error?
  • How to resolve "Failed to install the following Android SDK packages as some licences have not been accepted"?

Was this helpful?

Edit on GitHub
  1. Notes

Resolving Android Gradle Build Errors

PreviousFAQNextGoogle Play Services Authentication

Last updated 2 years ago

Was this helpful?

How to resolve "AAPT: error: unexpected element <queries> found in <manifest>" error?

queries tag in Android Manifest is a requirement when you use Target API 30. To let gradle(Build system on Android) process the manifest files with queries tag, the project needs to atleast use 5.6.4+ gradle version. All Unity versions from 2020.x support 5.6.4+ gradle version. So, you don't see this error on those unity versions.

For supporting queries tag(which is required for Android 11 support/Target API 30), Gradle Version needs to be 5.6.4+. To assure this, your unity's Android Gradle Version needs to be atleast nearest of 3.3.3/3.4.3/3.5.4/3.6.4/4.0.1 versions.

You need to edit the Android Plugin Version to any of the closest in above versions.

Android Gradle Plugin Version and Gradle Version are two different values and not the same.

If you are latest versions, you may see "Custom Base Gradle Template" option. Just enable it in Player Settings and edit baseProjectTemplate file to include above version.

How to resolve "Failed to install the following Android SDK packages as some licences have not been accepted"?

You may see the following error when building on Android.

Could not determine the dependencies of task ':unityLibrary:com.voxelbusters.essentialkit.androidlib:compileReleaseAidl'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-31 Android SDK Platform 31
     build-tools;29.0.2 Android SDK Build-Tools 29.0.2
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.

The above error is actually weird as Unity needs to pick the latest build-tools which ever is installed. In the above scenario I have 30.0.2 but still its complaining about 29.0.2 build tools.

To solve this, you need to do the following.

  1. Click on File -> Build Settings -> Player Settings

  2. Select Android Platform

  3. Expand Other Settings section

  4. Set Target API Level to API 31

  5. Make a build by clicking Build Settings -> Build/Build & Run

  6. It may prompt for updating the SDK, proceed updating

  7. After making the build, reset Target API back to Automatic

Here actually we are forcing Unity to update to latest SDK (in this context API 31) to avoid the error.

Set Target API
Update Android Gradle Version to nearest of 3.3.3/3.4.3/3.5.4/4.0.1