5

I successfully integrated the sdk with my app. My app is intended to run with Google Maps sdk for iOS6, and with Apple UIMapKit for iOS 4.3 and 5.x . Since I added the google maps framework, ios 4.3 won't run anymore. I changed the GLKit.framework and GoogleMaps.framework to "optional", and I get dyld: Symbol not found: _NSFileProtectionCompleteUntilFirstUserAuthentication before the app even starts. need your help :-)

Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
tomeron11
  • 374
  • 3
  • 14
  • hi, did you integrate it in your app following this documentation https://developers.google.com/maps/documentation/ios/start ? – DD_ Dec 26 '12 at 05:28
  • of course. it's already working in ios6 and not crushing on ios5 – tomeron11 Dec 27 '12 at 09:18
  • but i didn't get any response yet after applying for API key!! any idea why is it so ? – DD_ Dec 28 '12 at 09:53
  • Just out of curiosity why are you still supporting 4.3? If you look at current usage it's hardly used by anyone. – Dancreek Dec 28 '12 at 14:19
  • @Dancreek: About 8% of my users (in the last month) were using 4.x, so I'd prefer not to cut them off if I can. – Saxon Druce Dec 29 '12 at 00:02

2 Answers2

3

My app runs okay on iOS 4.3, with GLKit.framework and GoogleMaps.framework set to optional, and if I remove all calls to the Google API.

Could the reference to NSFileProtectionCompleteUntilFirstUserAuthentication be caused by some of your other code or other frameworks?

UPDATE:

Actually the above is wrong. I had forgotten to include the -ObjC linker flag in step 7 of the instructions. Without the -ObjC the app is able to run fine on iOS 4.3. Without the -ObjC flag on iOS 6 the call to [GMSServices provideAPIKey] succeeds, but the call to [GMSMapView mapWithFrame:camera:] fails silently (returns nil), so this isn't an option.

With the -ObjC flag in place, on iOS 4.3 I get the same error about _NSFileProtectionCompleteUntilFirstUserAuthentication.

I tried changing -ObjC to -force_load $(PROJECT_DIR)/GoogleMaps.framework/GoogleMaps, to only force loading of the Google Maps API and not other libraries, but it still fails on iOS 4.3.

I presume that the -ObjC or -force_load are overriding the setting to make GoogleMaps.framework optional.

Also, on iOS 5.0 I get a similar error about _NSURLIsExcludedFromBackupKey. I'm presuming it would work on iOS 5.1, though. @tomeron11, what version of 5.x were you testing with?

UPDATE 2:

It feels like a horrible hack, but adding the following to one of the .m files in the project allows it to work on iOS 5.0:

NSString* const NSURLIsExcludedFromBackupKey = @"NSURLIsExcludedFromBackupKey";

This doesn't seem to cause a problem on iOS 6.0, even though the symbol will have been defined twice, although I'm not sure if it can be trusted.

For iOS 4.3 I tried doing the equivalent, by adding:

NSString* const NSFileProtectionCompleteUntilFirstUserAuthentication = 
    @"NSFileProtectionCompleteUntilFirstUserAuthentication";

This stops the error about _NSFileProtectionCompleteUntilFirstUserAuthentication, but then I get the following error instead:

dyld: Symbol not found: _OBJC_CLASS_$_NSMutableOrderedSet

I'm not sure if there is a way to fool the linker into seeing a dummy version of NSMutableOrderedSet on iOS 4.3.

UPDATE 3:

The SDK documentation says that the minimum supported platform is iOS 5.1.

Google have closed the bug report as WontFix, so it seems there will be no way to get it to work on 5.0 or below.

UPDATE 4:

Google have reopened the bug as an Enhancement.

UPDATE 5:

The latest version 1.1.0 of the SDK now no longer crashes on startup on iOS 5.0.

However, Google will not be fixing the crash on iOS 4.x.

Since the SDK only officially supports iOS 5.1+, although it no longer crashes on startup on iOS 5.0, if you try to create a GMSMapView then it crashes with an error message:

Google Maps SDK for iOS only supports iOS 5.1+

If you use the hack which used to make it not crash on startup on 5.0, ie this:

NSString* const NSURLIsExcludedFromBackupKey = @"NSURLIsExcludedFromBackupKey";

Then the SDK will run on iOS 5.0. It seems to work, but it's probably not a good idea, as it is not officially supported by Google.

Saxon Druce
  • 17,406
  • 5
  • 50
  • 71
  • I raised this as a bug report on Google's issue tracker here: http://code.google.com/p/gmaps-api-issues/issues/detail?id=4750 – Saxon Druce Dec 29 '12 at 03:44
  • on 5.0 it's not working. i get "dyld: Symbol not found: _NSURLIsExcludedFromBackupKey". sorry about the miss-info. – tomeron11 Dec 30 '12 at 09:38
  • iOS6 up now unfortunately for people with stubborn clients – Adam Waite Jan 29 '14 at 14:27
  • iOS5 support was dropped with the release of SDK version 1.5. Backwards compatible version here: `pod 'Google-Maps-iOS-SDK', '~> 1.4.3'` – Adam Waite Jan 29 '14 at 14:29
0

I Foundation.framework and UIKit.framework(UIActivityViewController crashed in 1.5 GMSdk too.....) set in mode "option" (weak a no seen in combobox). NSMutableOrdererSet and NSURLIsExcludedFromBackupKey situated in this framework component. I don`t check how work this solution on ios less 5.0, but from 5.0 to 6.0 not crashed, or please not use Google Map SDK from 5 to 6 instead of this MKMapView!

P.S. Sorry my bad english!