Map Request Location Returning error 8

Hi guys,

I am having this map issue on the iPad. 

My code is simple. Get GPS latitude/longitude from an address.

Device ‘Settings -> Privacy -> Location Services’ is ON. I don’t think ON or OFF matters, as i get the same error on both.

Already added the request in iphone plist @ build.settings (NSLocationWhenInUseUsageDescription)

Code :

nativeMap:requestLocation( '123 road Singapore' , locationHandler )

Error :

no way to establish effective authorization. The operation couldn’t be completed. (kCLErrorDomain error 8.)

Any idea what’s wrong ?

Thanks

Can you provide more information:

What version of Corona SDK are you using?

What device and OS are you building and testing on?

Please post your build.settings file.

What happens if you don’t request a location?

Rob

It seems that if the address does not exist or gibberish, the error will occur. Still testing it out to discover more…

Here’s the info :

Corona 2016.2914

Tested on iPad mini iOS 9.3.2 & iPad iOS 9.3.2

build.settings :

settings = { plugins = { ["plugin.openssl"] = { publisherId = "com.coronalabs", }, ["plugin.notifications"] = { publisherId = "com.coronalabs" }, -- http://coronalabs.com/blog/2015/01/21/notifications-have-been-moved-to-a-plugin/ ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, -- AdMob -- ["facebook"] = { publisherId = "com.coronalabs" }, -- facebook ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, -- facebook-v4 }, build = { -- neverStripDebugInfo = false }, excludeFiles = { -- all = { "asset/custom\_estate/\*" }, -- all = { "asset/\*" }, }, android = { permissions = { { name = ".permission.C2D\_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.CALL\_PHONE", "android.permission.READ\_PHONE\_STATE", "android.permission.VIBRATE", "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.GET\_ACCOUNTS", -- For GCM push-notification "android.permission.RECEIVE\_BOOT\_COMPLETED", -- For GCM push-notification "com.google.android.c2dm.permission.RECEIVE", -- For GCM push-notification ".permission.C2D\_MESSAGE", -- For GCM push-notification "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", --"android.permission.CAMERA", -- Used in full version, to upload photo "android.permission.WRITE\_EXTERNAL\_STORAGE", -- Used in full version, to upload photo }, usesFeatures = { -- If you set permissions "ACCESS\_FINE\_LOCATION" and "ACCESS\_COARSE\_LOCATION" above, -- then you may want to set up your app to not require location services as follows. -- Otherwise, devices that do not have location sevices (such as a GPS) will be unable -- to purchase this app in the app store. { name = "android.hardware.location", required = false }, { name = "android.hardware.location.gps", required = false }, { name = "android.hardware.location.network", required = false }, }, facebookAppId = "xxx", }, orientation = { default = "portrait", supported = { "portrait", }, }, iphone = { plist = { ITSAppUsesNonExemptEncryption = false, NSLocationWhenInUseUsageDescription = "This app uses maps and location.", UIApplicationExitsOnSuspend = false, FacebookAppID = "xxx", -- (27-Apr-15) CFBundleURLTypes = { { CFBundleURLSchemes = { "xxx", -- } } }, -- For iOS9 : https://coronalabs.com/blog/2015/09/17/about-app-transport-security-ats/ NSAppTransportSecurity = { NSAllowsArbitraryLoads = true, NSExceptionDomains = { ["fbcdn.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["facebook.com"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["akamaihd.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, }, }, -- Whitelist Facebook Apps LSApplicationQueriesSchemes = { "fb", "fbapi20130214", "fbapi20130410", "fbapi20140410", "fbapi20140116", "fbapi20150313", "fbapi20150629", "fbauth", "fbauth2", "fb-messenger-api20140430", }, UIAppFonts = { -- "HelveticaNeue.ttf", -- "HelveticaNeue\_Lt.ttf", -- "HelveticaNeue\_Med.ttf", -- "HelveticaNeueBold.ttf", }, MinimumOSVersion = "7.0", UIStatusBarHidden = false, CFBundleIconFiles = { -- "AppIcon76x76@2x.png", -- "AppIcon76x76.png", -- "AppIcon72x72@2x.png", -- "AppIcon72x72.png", -- "AppIcon60x60@3x.png", -- "AppIcon60x60@2x.png", -- "AppIcon60x60.png", -- "AppIcon57x57@2x.png", -- "AppIcon57x57.png", -- "AppIcon50x50@2x.png", -- "AppIcon50x50.png", -- "AppIcon40x40@3x.png", -- "AppIcon40x40@2x.png", -- "AppIcon40x40.png", -- "AppIcon29x29@3x.png", -- "AppIcon29x29@2x.png", -- "AppIcon29x29.png", "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-167.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png" }, UILaunchImages = { { -- iPhone 4 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 5 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPad Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPhone 6 Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 Plus Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-736h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPad Pro Portrait ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Portrait-1336", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{1024, 1366}" }, { -- iPad Pro Landscape Right ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Landscape-1336", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{1024, 1366}" }, { -- iPad Pro Landscape Left ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Landscape-1336", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{1024, 1366}" }, }, }, }, }

The error seems to indicate a failure to geocode the address:

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CoreLocationConstantsRef/index.html#//apple_ref/c/econst/kCLErrorNetwork

Thanks. I thought it was some authorisation  problem.

Can you provide more information:

What version of Corona SDK are you using?

What device and OS are you building and testing on?

Please post your build.settings file.

What happens if you don’t request a location?

Rob

It seems that if the address does not exist or gibberish, the error will occur. Still testing it out to discover more…

Here’s the info :

Corona 2016.2914

Tested on iPad mini iOS 9.3.2 & iPad iOS 9.3.2

build.settings :

settings = { plugins = { ["plugin.openssl"] = { publisherId = "com.coronalabs", }, ["plugin.notifications"] = { publisherId = "com.coronalabs" }, -- http://coronalabs.com/blog/2015/01/21/notifications-have-been-moved-to-a-plugin/ ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, -- AdMob -- ["facebook"] = { publisherId = "com.coronalabs" }, -- facebook ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, -- facebook-v4 }, build = { -- neverStripDebugInfo = false }, excludeFiles = { -- all = { "asset/custom\_estate/\*" }, -- all = { "asset/\*" }, }, android = { permissions = { { name = ".permission.C2D\_MESSAGE", protectionLevel = "signature" }, }, usesPermissions = { "android.permission.CALL\_PHONE", "android.permission.READ\_PHONE\_STATE", "android.permission.VIBRATE", "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.GET\_ACCOUNTS", -- For GCM push-notification "android.permission.RECEIVE\_BOOT\_COMPLETED", -- For GCM push-notification "com.google.android.c2dm.permission.RECEIVE", -- For GCM push-notification ".permission.C2D\_MESSAGE", -- For GCM push-notification "android.permission.ACCESS\_FINE\_LOCATION", "android.permission.ACCESS\_COARSE\_LOCATION", --"android.permission.CAMERA", -- Used in full version, to upload photo "android.permission.WRITE\_EXTERNAL\_STORAGE", -- Used in full version, to upload photo }, usesFeatures = { -- If you set permissions "ACCESS\_FINE\_LOCATION" and "ACCESS\_COARSE\_LOCATION" above, -- then you may want to set up your app to not require location services as follows. -- Otherwise, devices that do not have location sevices (such as a GPS) will be unable -- to purchase this app in the app store. { name = "android.hardware.location", required = false }, { name = "android.hardware.location.gps", required = false }, { name = "android.hardware.location.network", required = false }, }, facebookAppId = "xxx", }, orientation = { default = "portrait", supported = { "portrait", }, }, iphone = { plist = { ITSAppUsesNonExemptEncryption = false, NSLocationWhenInUseUsageDescription = "This app uses maps and location.", UIApplicationExitsOnSuspend = false, FacebookAppID = "xxx", -- (27-Apr-15) CFBundleURLTypes = { { CFBundleURLSchemes = { "xxx", -- } } }, -- For iOS9 : https://coronalabs.com/blog/2015/09/17/about-app-transport-security-ats/ NSAppTransportSecurity = { NSAllowsArbitraryLoads = true, NSExceptionDomains = { ["fbcdn.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["facebook.com"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["akamaihd.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, }, }, -- Whitelist Facebook Apps LSApplicationQueriesSchemes = { "fb", "fbapi20130214", "fbapi20130410", "fbapi20140410", "fbapi20140116", "fbapi20150313", "fbapi20150629", "fbauth", "fbauth2", "fb-messenger-api20140430", }, UIAppFonts = { -- "HelveticaNeue.ttf", -- "HelveticaNeue\_Lt.ttf", -- "HelveticaNeue\_Med.ttf", -- "HelveticaNeueBold.ttf", }, MinimumOSVersion = "7.0", UIStatusBarHidden = false, CFBundleIconFiles = { -- "AppIcon76x76@2x.png", -- "AppIcon76x76.png", -- "AppIcon72x72@2x.png", -- "AppIcon72x72.png", -- "AppIcon60x60@3x.png", -- "AppIcon60x60@2x.png", -- "AppIcon60x60.png", -- "AppIcon57x57@2x.png", -- "AppIcon57x57.png", -- "AppIcon50x50@2x.png", -- "AppIcon50x50.png", -- "AppIcon40x40@3x.png", -- "AppIcon40x40@2x.png", -- "AppIcon40x40.png", -- "AppIcon29x29@3x.png", -- "AppIcon29x29@2x.png", -- "AppIcon29x29.png", "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-167.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png" }, UILaunchImages = { { -- iPhone 4 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 480}" }, { -- iPhone 5 Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPad Portrait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPhone 6 Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 Plus Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-736h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPad Pro Portrait ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Portrait-1336", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{1024, 1366}" }, { -- iPad Pro Landscape Right ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Landscape-1336", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{1024, 1366}" }, { -- iPad Pro Landscape Left ["UILaunchImageMinimumOSVersion"] = "9.0", ["UILaunchImageName"] = "Default-Landscape-1336", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{1024, 1366}" }, }, }, }, }

The error seems to indicate a failure to geocode the address:

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CoreLocationConstantsRef/index.html#//apple_ref/c/econst/kCLErrorNetwork

Thanks. I thought it was some authorisation  problem.