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 (13)

  1. 680d10e61268f0642176377a5ffaac4b?d=mm

    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.

  2. 942579c6fabfb545bacc458f84441d74?d=mm

    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.

  3. 33b28325f46658453fb8cccc43d6a6a5?d=mm

    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

  4. 2f9e362492d2f7a704a5bb1212fff182?d=mm

    slooga

    Mar 13, 2020 19:57

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

  5. 6ca6dfba12067c24812a5d5a00dc47f2?d=mm

    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.

  6. 0f2284ca7c1f7907773c22a6eb7abd55?d=mm

    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.

  7. 1242652b434a62498328fc4a4bc72d38?d=mm

    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!

  8. 461c2a20a57c06e93cbbb3d201ed5a9e?d=mm

    oscarflo700

    Jul 01, 2019 17:41

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

  9. 5505f9574572edd1103f430cad8631fe?d=mm

    Fillmore

    Jun 07, 2019 20:41

    Reproducible On: 2019.3.0.a5

  10. 5505f9574572edd1103f430cad8631fe?d=mm

    Fillmore

    Jun 07, 2019 20:39

    Got this today directly after updating Unity and attempting a first build to a new xcode location.

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.