- Home /
The question is answered, right answer was accepted
Issue with building to XCode
Hello, all.
While building for my iOS game, I have encountered issues regarding the build process. While building, I recieve an error stating 'Calling TargetGuidByName with name='Unity-iPhone' is deprecated. There are two targets now, call GetUnityMainTargetGuid()...' this doesn't affect the build however, and I can still run the file in XCode. Unfortunately, while building in XCode, I recieve a related error stating 'UnityAds/UnityAds.h not found'. Even after resetting targets and attempting to resolve this problem, I get faced with more Unity Ad related issues. I believe the problem has to do with the Unity Editor itself.
I have been stuck with this issue for a few days now, resetting Unity Ad services, Player Settings, and other project settings, but I have not found a solution. I am reaching out to see if anybody has an answer.
Version: Using 2019.3.0a5 (Also tested with 2019.3.0a10, same issue occurs Services: I am using Unity Ads from the Service Window in Unity. Issue: Error recieved when building for iOS, error appearing after the build has completed "Successfully" Issue in XCode: UnityAds/UnityAds.h not found (Resolved by changing target from Unity-iPhone.framework to Unity-iPhone)
Issues that pop up after the first XCode issue: "_UnityAdsEngineSetMetaData", referenced from: "_UnityAdsEngineGetPlacementState", referenced from: ...And 11 other 'referenced from' errors regarding Unity Ads
If you need any more information, please comment and I will try and respond asap.
Here is the whole error message: 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.
Here is the error code in it's entirety: UnityEditor.iOS.Xcode.PBXProject.TargetGuidByName (System.String name) (at C:/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 :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 :0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0) UnityEditor.Build.BuildPipelineInterfaces+AttributeCallbackWrapper.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:158) UnityEditor.Build.BuildPipelineInterfaces+c_AnonStorey2.<>m_1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at C:/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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:356) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Thank you for anybody involved with this!
Answer by Bubinga_Studios · Aug 02, 2019 at 09:41 PM
Solved it. Check out This thread if you are still having the issue