Error occurred when 'il2cpp Android build' in Unity

3.3k Views Asked by At

error :

    Exception: Failed running D:\UnityEditor\2021.1.9f1\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe @D:/UnityProject/ProjectName/Temp/StagingArea/assets/bin/Data/Managed/response.rsp
        
    stdout:
    Fatal error in Unity CIL Linker
    Mono.Linker.LinkerFatalErrorException: ILLink: error IL1005: GoogleMobileAds.Api.MobileAds.GetClientFactory(): Error processing method
    'GoogleMobileAds.Api.MobileAds.GetClientFactory()' in assembly 'GoogleMobileAds.dll'---> System.InvalidOperationException: No action for the assembly GoogleMobileAds.Unity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null defined

use :

  • Unity 2021.1.9f1 -> ndk r21d
  • Visual Studio Community 2019 16.10.0
  • GoogleMobileAds-v6.0.0.unitypackage
  • android studio 4.2.1 -> avd test use

build setting :
- Minimum API Level : level 29
- Scripting Backend : il2cpp
- Api Compatibility Level : .Net 4.x
- Target Architextures : ARMv7 && ARM64

try :
- Mono build fine.
- reimport all the packages.
- reinstalled Visual Studio c++ targeting pack(4.0~4.8 version).
- reinstalled .Net 4.8 framwork.
- Preferences JDK, SDK, NDK, Gradle Set with downloaded files path. Not Installed with UnityHub recommended path.
- GoogleMobileAds-v5.4.0 change.
- I tried to edit Use GUIDs in 'GoogleMobileAds.Editor', but 'GoogleMobileAds' and 'GoogleMobileAds.Core' are output as 'none'.

All have the same error.
1

There are 1 best solutions below

2
On BEST ANSWER

This is a bug in version 6.0.0 of the Google Mobile Ads Unity plugin. Tracked in https://github.com/googleads/googleads-mobile-unity/issues/1613.