{"id":4196,"date":"2021-10-08T23:36:15","date_gmt":"2021-10-09T04:36:15","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4196"},"modified":"2021-10-08T23:37:08","modified_gmt":"2021-10-09T04:37:08","slug":"unity-fails-to-build-ios-game-due-to-locationservice-being-used","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/unity-fails-to-build-ios-game-due-to-locationservice-being-used\/","title":{"rendered":"Unity Fails to Build iOS Game due to &#8220;LocationService&#8221; being used"},"content":{"rendered":"\n<p>Ran into an interesting problem while trying to compile a Unity project for iOS.  It failed to build because <\/p>\n\n\n\n<p>&#8220;LocationService class is used but Locations Usage Description is empty. App will not work on iOS 10+.<br>UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&amp;)&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"74\" src=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4-1024x74.png\" alt=\"\" class=\"wp-image-4197\" srcset=\"https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4-1024x74.png 1024w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4-300x22.png 300w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4-768x56.png 768w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4-1536x112.png 1536w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4-500x36.png 500w, https:\/\/www.incredigeek.com\/home\/wp-content\/uploads\/2021\/10\/image-4.png 1611w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>LocationService class is used but Locations Usage Description is empty<\/figcaption><\/figure>\n\n\n\n<p>Well as far as I know there is not anything calling or requesting location services.  I probably could have just put a reason for requesting the service under the build options in Project Settings.  But why &#8220;use&#8221; something we don&#8217;t need?<\/p>\n\n\n\n<p>Using the handy grep tool from a terminal, I was able to search through the project for &#8220;LocationService&#8221; and that returned a couple hits for files in the PlayMaker folder.<\/p>\n\n\n\n<p>Looks like PlayMaker has a couple preconfigured &#8220;scripts&#8221; for Starting, Stopping, and Requesting Location.  <\/p>\n\n\n\n<p>Deleting the following four C# files resolved the error and it built fine afterwards.<\/p>\n\n\n\n<p>GetLocationInfo<br>StopLocationServiceUpdates<br>StartLocationServiceUpdates<br>ProjectLocationToMap<\/p>\n\n\n\n<p>You can find these files in your project under Assets > PlayMaker > Actions > Device<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ran into an interesting problem while trying to compile a Unity project for iOS. It failed to build because &#8220;LocationService class is used but Locations Usage Description is empty. App will not work on iOS 10+.UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&amp;)&#8221; Well as far &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/unity-fails-to-build-ios-game-due-to-locationservice-being-used\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[325],"tags":[1251,403,486,685,1252,328,326,327],"class_list":["post-4196","post","type-post","status-publish","format-standard","hentry","category-unity3d","tag-dev","tag-development","tag-game","tag-location","tag-locationservice","tag-macos","tag-unity","tag-unity3d"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4196"}],"version-history":[{"count":4,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4196\/revisions"}],"predecessor-version":[{"id":4201,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4196\/revisions\/4201"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}