我在应用程序中使用 Google Plus API 来共享内容。 我使用这些行在我的应用程序中显示 native 共享对话框:
id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];
[shareBuilder setPrefillText:MY_TEXT];
[shareBuilder setURLToShare:[NSURL URLWithString:MY_URL];
[shareBuilder open];
对话框已成功显示。当我触摸“公开”以更改隐私时,应用程序立即崩溃。
我正在使用 XCode 5,我的 iPhone 是 iOS 5.0。 XCode 显示日志:
Uncaught exception:
-[NSCache setObject:forKey:cost:]: attempt to insert nil value (key:acl_public_com.google.GPPCommonSharedResources)
Stack trace: (
0 CoreFoundation 0x33e6f8d7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x340bf1e5 objc_exception_throw + 32
2 CoreFoundation 0x33e00cf5 +[NSObject copyWithZone:] + 0
3 CoreFoundation 0x33e024a1 -[NSCache setObject:forKey:] + 44
4 MyApp 0x002f86e5 +[UIImage(GPPAdditions) gpp_setCachedImage:forKey:]
5 MyAPP 0x002f8535 +[UIImage(GPPAdditions) gpp_imageNamed:bundle:] + 220
6 MyApp 0x002f85df +[UIImage(GPPAdditions) gpp_imageNamed:tint:bundle:] + 13
请帮我解决这个问题。
最佳答案
这个问题的解决办法相当简单。不过我花了 3 天的时间来解决这个问题。在使用 google 的示例应用程序时,我发现我的应用程序的自定义 iOS 目标属性中缺少包名称。只需添加一个简单的行 ${PRODUCT_NAME}
就可以了:D
关于ios - 适用于 iOS 的 Google Plus API : Share function - Crash app when touching "Public" in the native dialog share?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19286115/