1

Integrating the IronSource plugin (v7.0.4.1) doesn't cause any issues. I know this because I am still able to build an APK successfully after installing it. Integrating some of the adapters such as AdColony and UnityAds also do not result in any problems.

However, once I try to integrate the AdMob adapter, I can no longer build an APK. I just get a prompt that says "Android resource linking failed. See the Console for details". Clicking OK results in these error logs:

enter image description here enter image description here enter image description here

threedollarbill
  • 165
  • 2
  • 11
  • Try to update the version and the SDK and NDK and try again – Leoverload Dec 14 '20 at 11:23
  • I believe there is missing detailed information in one of these logs. You should post the full log in Editor Log by clicking on the three dots button in the Console window > Open Editor Log. More info on Editor Log here https://answers.unity.com/questions/9739/how-can-i-find-editor-log-file.html – Trong Nguyen Dec 15 '20 at 03:58

3 Answers3

0

In my case, the old audience network plugin caused the problem. Build failed when both Audience network and AdMob were present. After removing the audience network plugin (as I am not using it), the build was successful. Update SDK, and other plugins. Resolve, and then try again.

Opu
  • 1
0

Solution

The AdMob SDK requires use of the <queries> tag which for Unity 2018 and higher needs a newer Gradle feature which doesn't come with the Gradle version Unity packages.

Here is another post with the same issue.

Reaver
  • 101
  • 3
0

Tested : Unity 2020.3.11f1 and GoogleMobileAds-v6.1.2

Step 01 : Install GoogleMobileAds plugin and setup and Asset > External Dependency Manager > Android Resolver > resolve.

Step 02 : Set Target API Level 30 in Player Setting.

enter image description here

Step 03 : Tick in Custom Main Gradle Template and Custom Launcher Gradle Template.

enter image description here

Step 04: How mainTemplate and launcherTemplate files generating. [If not view then first build ignore the errors]

enter image description here

Step 05 : Added below code into mainTemplate.gradle file with your favorite editor.

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        // Must be Android Gradle Plugin 3.6.0 or later. For a list of
        // compatible Gradle versions refer to:
        // https://developer.android.com/studio/releases/gradle-plugin
        classpath 'com.android.tools.build:gradle:3.6.0'
    }
}

allprojects {
   repositories {
      google()
      mavenCentral()
      flatDir {
        dirs 'libs'
      }
   }
}

//Look like that enter image description here

Step 06 : Download Gradle gradle-5.6.4-all.zip from grdale.org. Download from https://services.gradle.org/distributions/

After download extract the file and set gradle path into Edit > Preference > External Tools > Gradle Install with Unity(recommended) UnChecked

enter image description here

Step 07 : Build

Helpful Link : https://developers.google.com/ar/develop/unity-arf/android-11-build

Atul Patel
  • 71
  • 2