适用于iOS的Google Maps SDK尝试在iOS 4.3上运行 [英] Google Maps SDK for iOS trying to run on iOS 4.3

查看:122
本文介绍了适用于iOS的Google Maps SDK尝试在iOS 4.3上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功将 sdk 与我的应用集成。
我的应用程序适用于适用于iOS6的Google Maps sdk
以及Apple UIMapKit for iOS 4.3和5.x.
由于我添加了谷歌地图框架,
ios 4.3将不再运行。
我将 GLKit.framework GoogleMaps.framework 更改为可选,
和在应用程序启动之前,我得到 dyld:未找到符号:_NSFileProtectionCompleteUntilFirstUserAuthentication
需要你的帮助:-)

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 :-)

推荐答案

我的应用程序在iOS 4.3上运行正常, GLKit.framework GoogleMaps.framework 设置为可选,如果我删除了对Google API的所有调用。

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.

NSFileProtectionCompleteUntilFirstUserAuthentication 的引用是否可能是由您的某些其他代码或其他框架引起的?

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

更新:

实际上以上是错误的。我忘了在 -ObjC 链接器标记adding_the_google_maps_sdk_for_ios_to_your_projectrel =nofollow>说明。如果没有 -ObjC ,该应用程序可以在iOS 4.3上正常运行。如果没有iOS 6上的 -ObjC 标志,对 [GMSServices provideAPIKey] 的调用会成功,但对<$ c的调用会成功$ c> [GMSMapView mapWithFrame:camera:] 无声地失败(返回nil),所以这不是一个选项。

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.

使用 -ObjC 标志到位,在iOS 4.3上我得到了与 _NSFileProtectionCompleteUntilFirstUserAuthentication 相同的错误。

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

我尝试将 -ObjC 更改为 -force_load $(PROJECT_DIR)/GoogleMaps.framework/GoogleMaps ,仅强制加载Google Maps API而不是其他库,但在iOS 4.3上仍然无法加载。

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.

我认为 - ObjC -force_load 覆盖了设置 GoogleMaps.framework 可选。

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

此外,在iOS 5.0上,我收到类似的关于 _NSURLIsExcludedFromBackupKey 的错误。不过,我认为它可以在iOS 5.1上运行。 @ tomeron11,您测试的是什么版本的5.x?

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?

更新2:

感觉好像是一个可怕的黑客攻击,但是将以下内容添加到项目中的某个.m文件允许它在iOS 5.0上运行:

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";

这不会似乎导致iOS 6.0出现问题,甚至虽然这个符号已被定义了两次,但我不确定它是否可以信任。

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.

对于iOS 4.3,我尝试通过添加:

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

NSString* const NSFileProtectionCompleteUntilFirstUserAuthentication = 
    @"NSFileProtectionCompleteUntilFirstUserAuthentication";

这会停止关于 _NSFileProtectionCompleteUntilFirstUserAuthentication 的错误,但是然后我得到以下错误:

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

dyld: Symbol not found: _OBJC_CLASS_$_NSMutableOrderedSet

我不确定是否有办法欺骗链接器在iOS 4.3上看到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.

更新3:

SDK文档说支持的最低平台是iOS 5.1

Google已将以错误报告关闭为WontFix ,所以似乎没有办法让它在5.0或更低版本上运行。

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.

更新4:

Google有将错误重新打开为增强功能

更新5:

SDK的最新版本1.1.0现在不再在iOS 5.0上启动时崩溃。

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

然而, Google不会修复iOS 4.x上的崩溃

由于SDK仅正式支持iOS 5.1+,但在iOS 5.0上启动时不再崩溃,如果您尝试创建 GMSMapView 然后它崩溃并显示错误消息:

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仅支持iOS 5.1 +

Google Maps SDK for iOS only supports iOS 5.1+

如果您使用的hack在5.0上启动时不会崩溃,即:

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

NSString* const NSURLIsExcludedFromBackupKey = @"NSURLIsExcludedFromBackupKey";

然后SDK将在iOS 5.0上运行。它似乎有效,但它可能不是一个好主意,因为它没有得到Google的正式支持。

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.

这篇关于适用于iOS的Google Maps SDK尝试在iOS 4.3上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆