Search Issue Tracker

Fixed in 3.1.1

Votes

5

Found in [Package]

2.0.8

Issue ID

1154001

Regression

Yes

[iOS] Build and run fails on mac for iOS with the default ads package

Package: Ads

-

[iOS] Build and run fails on mac for iOS

Steps To Reproduce:

1. Create a project
2. Switch platform to iOS
3. Player Settings > Team ID > Enter a Valid Team ID
4. Build Settings > Build and Run

Expected Result: Builds successfully and runs on the connected iOS device

Observed Result: Build fails with errors in the console

Workaround: Works fine on upgrading the ad package to 3.0.2 or higher

Reproducible On: 2019.3.0.a2

Not Reproducible On: 2019.3.0a1

Stack Trace:

1.UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
2. Error building Player: Exception: Calling TargetGuidByName with name='Unity-iPhone' is deprecated. There are two targets now, call GetUnityMainTargetGuid() - for app or GetUnityFrameworkTargetGuid() - for source/plugins to get Guid instead.
3. Exception: Calling TargetGuidByName with name='Unity-iPhone' is deprecated. There are two targets now, call GetUnityMainTargetGuid() - for app or GetUnityFrameworkTargetGuid() - for source/plugins to get Guid instead.
UnityEditor.iOS.Xcode.PBXProject.TargetGuidByName (System.String name) (at /Users/builduser/buildslave/unity/build/External/XcodeAPI/Xcode/PBXProject.cs:168)
UnityEditorInternal.Advertisements.UnityAdsPostprocessor.EditXcodeProject (System.String buildFolder) (at /home/builduser/buildslave/com.unity.ads/package/Source/UnityAdsEditor/UnityAdsPostprocessor.cs:101)
UnityEditorInternal.Advertisements.UnityAdsPostprocessor.PostProcessBuild_iOS (UnityEditor.BuildTarget target, System.String path) (at /home/builduser/buildslave/com.unity.ads/package/Source/UnityAdsEditor/UnityAdsPostprocessor.cs:92)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <23c160f925be47d7a4fd083a3a62c920>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <23c160f925be47d7a4fd083a3a62c920>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <23c160f925be47d7a4fd083a3a62c920>:0)
UnityEditor.Build.BuildPipelineInterfaces+AttributeCallbackWrapper.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:158)
UnityEditor.Build.BuildPipelineInterfaces+<OnBuildPostProcess>c__AnonStorey2.<>m__1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:398)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Environment: Occurs only on Mac

Comments (14)

  1. JoeStrout

    Jan 02, 2021 02:26

    Rather than upgrading the (unused) Ads package, it worked for me to simply remove it (using the Remove button at bottom-left of the Package Manager window).

  2. infosekr

    May 25, 2020 23:26

    Is there another way to fix this without installing the Advertisement package? I cannot add this package because I'm using an ad mediator that packages up Unity Ads itself so if I add the package I'll get duplicate library conflicts. I'm using Unity 2019.3.11f1.

  3. Reisender

    May 13, 2020 20:06

    Having the same issue on 2019.3.10f1, not using anything related to ads, but still I tried the solution here and installed the Advertisement package v3.4.5

    The error is still there after that.

  4. TurleyE

    Mar 20, 2020 04:09

    Just having the Ads package (which I never selected to have) created the problem. Upgraded to latest version (just...because, seeing I wasn't using it anyway) and all good with that error now.
    Unity 2019.3.5f1

  5. slooga

    Mar 13, 2020 19:57

    I am not using the Ads package, but this also worked for me.

  6. ammannagari

    Feb 05, 2020 20:13

    Hi, I have upgraded unity to 2019.3.0f6 . I am having the same issue while building and upgrading the Ads to 3.20 did not help me. I tried to update to 3.4.2 as well but no luck.

    Looking for some help on this.

  7. ThisLove

    Jan 16, 2020 22:19

    lol And it took me a couple minutes to figure out you have to tap the triangle next to "Ads" or "Advertisements" turning on the drop down menu so you can select the version to update.

  8. Bubinga_Studios

    Aug 02, 2019 21:22

    Reproducible On: 2019.3.0.a5 and 2019.3.0.a10 got this issue. After a couple days of scratching my head, I finally figured out a fix to the problem. I just had to update the Advertisement package in my unity packages!

    How to update:
    Go to Window > Package Manager
    Find a tab called 'Ads' or 'Advertisement'
    Select 3.2.0 from the 'Ads' dropdown menu
    Click 'Update to 3.2.0'

    After this, you should be set to go. Hope this helps, and saves you some time!

  9. oscarflo700

    Jul 01, 2019 17:41

    How did you update the ads package ? thanks in advance.

  10. Fillmore

    Jun 07, 2019 20:41

    Reproducible On: 2019.3.0.a5

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.