Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Problem in building project with Admob

Discussion in 'Unity Ads & User Acquisition' started by m4ksim4ks, Jun 8, 2023.

  1. m4ksim4ks

    m4ksim4ks

    Joined:
    Jun 14, 2022
    Posts:
    3
    The error occurred after installing Admob sdk and switching Scripting Backend (Project settings -> player -> Other settings / Configuration) to IL2CPP
    Works on Mono, but G.Play does not accept
    Error:
    Building Library\Bee\artifacts\Android\ManagedStripped failed with output:
    D:\cpp22_33\Unity Hub\2022.1.14f1\Editor\Data\il2cpp\build\deploy\UnityLinker.exe --search-directory=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed --out=Library/Bee/artifacts/Android/ManagedStripped --include-link-xml=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed\MethodsToPreserve.xml --include-link-xml=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed\TypesInScenes.xml --include-link-xml=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed\SerializedTypes.xml --include-link-xml=D:\Games\Unity\Kangaroo\Temp\burst.link.xml --include-link-xml=D:\Games\Unity\Kangaroo\Assets\GoogleMobileAds\link.xml --include-link-xml=D:/cpp22_33/Unity Hub/2022.1.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools/AndroidNativeLink.xml --include-directory=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed --dotnetprofile=unityaot-linux --dotnetruntime=Il2Cpp --platform=Android --use-editor-options --enable-engine-module-stripping --engine-stripping-flag=EnableUnityConnect --engine-stripping-flag=EnablePerformanceReporting --engine-stripping-flag=EnableAnalytics --engine-modules-asset-file=D:/cpp22_33/Unity Hub/2022.1.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/modules.asset --editor-data-file=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed/EditorToUnityLinkerData.json --include-unity-root-assembly=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --include-unity-root-assembly=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll --include-unity-root-assembly=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed/UnityEngine.Purchasing.Codeless.dll --include-unity-root-assembly=D:/Games/Unity/Kangaroo/Temp/StagingArea/Data/Managed/GoogleMobileAds.Common.dll --print-command-line
    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=7.3.1.0, Culture=neutral, PublicKeyToken=null defined
    at Mono.Linker.AnnotationStore.GetAction(AssemblyDefinition assembly)
    at Mono.Linker.Steps.MarkStep.MarkCustomAttributes(ICustomAttributeProvider provider, DependencyInfo& reason, IMemberDefinition sourceLocationMember)
    at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
    at Mono.Linker.Steps.MarkStep.MarkTypeVisibleToReflection(TypeReference reference, DependencyInfo reason, IMemberDefinition sourceLocationMember)
    at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.<>c__DisplayClass20_4.<HandleCa ll>b__7()
    at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.HandleCall(MethodBody callingMethodBody, MethodReference calledMethod, Instruction operation, ValueNodeList methodParams, ValueNode& methodReturnValue)
    at Mono.Linker.Dataflow.MethodBodyScanner.HandleCall(MethodBody callingMethodBody, Instruction operation, Stack`1 currentStack)
    at Mono.Linker.Dataflow.MethodBodyScanner.Scan(MethodBody methodBody)
    at Mono.Linker.Dataflow.ReflectionMethodBodyScanner.ScanAndProcessReturnValue(Metho dBody methodBody)
    at Unity.Linker.Steps.UnityMarkStep.MarkReflectionLikeDependencies(MethodBody body, Boolean requiresReflectionMethodBodyScanner)
    at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
    at Unity.Linker.Steps.UnityMarkStep.MarkMethodBody(MethodBody body)
    at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
    at Unity.Linker.Steps.UnityMarkStep.ProcessMethod(MethodDefinition method, DependencyInfo& reason)
    at Mono.Linker.Steps.MarkStep.ProcessQueue()
    --- End of inner exception stack trace ---
    at Mono.Linker.Steps.MarkStep.ProcessQueue()
    at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
    at Mono.Linker.Steps.MarkStep.Process()
    at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
    at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
    at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
    at Mono.Linker.Pipeline.Process(LinkContext context)
    at Unity.Linker.UnityDriver.UnityRun(Boolean noProfilerAllowed, ILogger customLogger)
    at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger, Boolean noProfilerAllowed)
    at Unity.Linker.UnityDriver.RunDriver()
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    592
    Hi, it looks like this issue is caused by the Admob SDK, which is out of our control, I would encourage you to contact Admob directly.
     
  3. mainleafgames

    mainleafgames

    Joined:
    Aug 27, 2021
    Posts:
    3
    It seems that the error is related to the IL2CPP backend not being able to process the GoogleMobileAds.Api.MobileAds.GetClientFactory() method in the assembly GoogleMobileAds.dll. The error message suggests that the GoogleMobileAds.Unity assembly is missing an action that is needed for the IL2CPP backend to process the method.
    To fix this error, you may need to update the Google Mobile Ads SDK or try using a different version of the SDK that is compatible with the IL2CPP backend. You can also try removing and re-importing the SDK to see if that resolves the issue.
    If the issue persists, you may need to reach out to the Google Mobile Ads support team for further assistance.