Skip to content

Unity ‐ Android Build ‐ Errors And How To Solve them

Mipo edited this page Oct 12, 2024 · 6 revisions

Android Build Errors and How To Solve them

Here we collected some documentation no how to avoid some cimplation errors.

Unity 2022.3.50f1, AdMob 9.2.1, Firebase 12.3.0

(1) Error: SDK licenses are not accepted

This is the MAC Os command that will find all SDK installation inside all Unity Editors and for each execute sdkmanager --licenses to accept them

find /Applications/Unity/Hub/Editor -name "sdkmanager" -exec {} --licenses \;

source

(2) Error: Gradle sdk35 is not supported

To avoid this kind of warning simply modify your file Assets\Plugins\Android\gradleTemplate.properties and add following row

android.suppressUnsupportedCompileSdk=35

source

(3) Error: Exception java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider

This is sometimes happening due to fact that Assets\Plugins\Android\AndroidManifest.xml missing declaration for AdMod Identiefier. If this is your case that modify this file and ensure that it contains this XML Tag under mainfest\appilcation node:

    <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-5814634538458183~9798xxxxxx"/>

this android value should com from your AdMod application setting definition. If this does not solve the issue that Check in the Player Settings:

Publishing Settings\Minify\Release = True