解析 iOS:尝试运行应用程序时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15457136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 22:45:50  来源:igfitidea点击:

Parse for iOS: Errors when trying to run the app

iosparse-platform

提问by Sarabyte Studios

I've been working with the Parse SDK and I followed the quickstep guide. When I try to run, I get these 8 errors. Any ideas as to why? It looks like something to do with the Facebook part of Parse which I'm not using.

我一直在使用 Parse SDK,并遵循了快速步骤指南。当我尝试运行时,出现这 8 个错误。关于为什么的任何想法?它看起来与我没有使用的 Parse 的 Facebook 部分有关。

 Undefined symbols for architecture armv7:
"_FBTokenInformationTokenKey", referenced from:
  -[PFFacebookTokenCachingStrategy accessToken] in Parse(PFFacebookTokenCachingStrategy.o)
  -[PFFacebookTokenCachingStrategy setAccessToken:] in Parse(PFFacebookTokenCachingStrategy.o)
 "_FBTokenInformationExpirationDateKey", referenced from:
  -[PFFacebookTokenCachingStrategy cacheTokenInformation:] in     Parse(PFFacebookTokenCachingStrategy.o)
  -[PFFacebookTokenCachingStrategy expirationDate] in Parse(PFFacebookTokenCachingStrategy.o)
  -[PFFacebookTokenCachingStrategy setExpirationDate:] in Parse(PFFacebookTokenCachingStrategy.o)
 "_OBJC_METACLASS_$_FBSessionTokenCachingStrategy", referenced from:
  _OBJC_METACLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBSessionTokenCachingStrategy", referenced from:
  _OBJC_CLASS_$_PFFacebookTokenCachingStrategy in Parse(PFFacebookTokenCachingStrategy.o)
"_FBTokenInformationUserFBIDKey", referenced from:
  -[PFFacebookTokenCachingStrategy facebookId] in Parse(PFFacebookTokenCachingStrategy.o)
  -[PFFacebookTokenCachingStrategy setFacebookId:] in Parse(PFFacebookTokenCachingStrategy.o)
"_OBJC_CLASS_$_FBRequest", referenced from:
  objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
"_OBJC_CLASS_$_FBSession", referenced from:
  objc-class-ref in Parse(PFFacebookAuthenticationProvider.o)
 ld: symbol(s) not found for architecture armv7
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

回答by blueHula

This is some sort of bug associated with the Parse iOS 1.1.33 release as multiple people are seeing the same errors- myself included.

这是与 Parse iOS 1.1.33 版本相关的某种错误,因为很多人都看到了相同的错误——包括我自己。

There are a couple of workarounds-

有几种解决方法-

If you're not using a library which requires the -ObjC linker flag, you can remove -ObjC from your project:

如果您不使用需要 -ObjC 链接器标志的库,则可以从项目中删除 -ObjC:

Build Settings > Other Linker Flags > remove -ObjC

构建设置 > 其他链接器标志 > 删除 -ObjC

or if you are using a library which requires that flag, you can add the Facebook SDK.

或者,如果您使用的库需要该标志,则可以添加 Facebook SDK。

Both options will eliminate the errors. Hopefully they fix this as I have no need for the Facebook SDK in my app.

这两个选项都将消除错误。希望他们解决这个问题,因为我的应用程序中不需要 Facebook SDK。

Follow the discussion here:

关注这里的讨论:

https://parse.com/questions/cocoapods-incompatibility

https://parse.com/questions/cocoapods-incompatibility

回答by dbquarrel

Here's a potentially simpler workaround than downloading, compiling, and installing the FB kit which is kind of large and cumbersome. Note that, of course, you won't be able to use any of the FB type functionality in Parse and you will run into severe issues if you trigger any of the Parse code that is expecting to use these dummy symbols. But, if you stay away from them you'll be OK I think. So...

这是一个可能比下载、编译和安装 FB 套件更简单的解决方法,后者有点大而且麻烦。请注意,当然,您将无法在 Parse 中使用任何 FB 类型的功能,并且如果您触发任何期望使用这些虚拟符号的 Parse 代码,您将遇到严重问题。但是,如果你远离他们,我想你会没事的。所以...

  1. Create an object in your application called FBMissingSymbols

  2. Delete the .h you won't need it

  3. Put this in the .m :

  1. 在您的应用程序中创建一个名为 FBMissingSymbols 的对象

  2. 删除您不需要的 .h

  3. 把它放在 .m 中:

NSString *FBTokenInformationExpirationDateKey = @"";
NSString *FBTokenInformationTokenKey = @"";
NSString *FBTokenInformationUserFBIDKey = @"";
@interface FBAppCall:NSObject
@end
@implementation FBAppCall
@end
@interface FBRequest:NSObject
@end
@implementation FBRequest
@end
@interface FBSession:NSObject
@end
@implementation FBSession
@end
@interface FBSessionTokenCaching:NSObject
@end
@implementation FBSessionTokenCaching
@end
@interface FBSessionTokenCachingStrategy:NSObject
@end
@implementation FBSessionTokenCachingStrategy
@end

回答by Marco Martignone

You have to delete the old ParseFacebookUtils.frameworkand keep the new ParseFacebookUtilsV4.frameworkto get it working.

您必须删除旧的ParseFacebookUtils.framework并保留新ParseFacebookUtilsV4.framework的才能使其正常工作。

回答by Nate Lee

I loved dbquarrel's answer, but it doesn't work anymore because it is lacking some new social classes.

我喜欢 dbquarrel 的回答,但它不再起作用,因为它缺少一些新的社会阶层。

So do the same thing, but instead, add this:

所以做同样的事情,但相反,添加以下内容:

NSString *FBTokenInformationExpirationDateKey = @"";
NSString *FBTokenInformationTokenKey = @"";
NSString *FBTokenInformationUserFBIDKey = @"";
NSString *SLServiceTypeTwitter = @"";
NSString *ACAccountTypeIdentifierTwitter = @"";
@interface FBAppCall:NSObject
@end
@implementation FBAppCall
@end
@interface FBRequest:NSObject
@end
@implementation FBRequest
@end
@interface FBSession:NSObject
@end
@implementation FBSession
@end
@interface FBSessionTokenCaching:NSObject
@end
@implementation FBSessionTokenCaching
@end
@interface FBSessionTokenCachingStrategy:NSObject
@end
@implementation FBSessionTokenCachingStrategy
@end
@interface ACAccountStore:NSObject
@end
@implementation ACAccountStore
@end
@interface SLRequest:NSObject
@end
@implementation SLRequest
@end
@interface SLComposeViewController:NSObject
@end
@implementation SLComposeViewController
@end

回答by ewakened

Check and make sure that you do not have two versions of the "ParseFacebookUtils" framework added there is:

检查并确保您没有添加两个版本的“ParseFacebookUtils”框架:

ParseFacebookUtilsV4 and ParseFacebookUtils

ParseFacebookUtilsV4 和 ParseFacebookUtils

Once I removed ParseFacebookUtils, and kept ParseFacebookUtilsV4 it worked fine.

一旦我删除了 ParseFacebookUtils,并保留了 ParseFacebookUtilsV4,它就可以正常工作。

回答by Biranchi

My Solution will definitely work and you can use -ObjC in other linker flags.

我的解决方案肯定会起作用,您可以在其他链接器标志中使用 -ObjC。

  1. Add "Social.framework" , "Account.framework"
  2. Add "FacebookSDK.framework"
  1. 添加 "Social.framework" , "Account.framework"
  2. 添加“FacebookSDK.framework”

Cheers....now it works..... and no need of removing -ObjC.

干杯......现在它可以工作......并且不需要删除-ObjC。

回答by Pete

Sounds like you might need to add the 'Accounts.Framework' and/or the 'Social.Framework'.

听起来您可能需要添加“Accounts.Framework”和/或“Social.Framework”。

回答by BabyPanda

A complementary to the answer by @blueHula . Parse has removed Facebook SDK from its framework, meaning that from some certain version (1.1.33 maybe) integrating parse.framework should be accompanied by integrating FB SDK independently.

对@blueHula 的回答的补充。Parse 已经从其框架中移除了 Facebook SDK,这意味着从某些版本(可能是 1.1.33)开始,集成 parse.framework 应该伴随着独立集成 FB SDK。

Please refer to this link using the parse ios sdk without including the facebook sdk

使用解析 ios sdk参考此链接,但不包括 facebook sdk

The key point is to use -force_load $(SRCROOT)/path/libname.ato link with necessary third-party libraries, rather than using -all_loadand -ObjC

关键是使用-force_load $(SRCROOT)/path/libname.a链接必要的第三方库,而不是使用-all_load-ObjC

回答by ryebread

It is a linker error... You are not including a needed framework in your project which you are referencing in one of you included header files.

这是一个链接器错误......您没有在您的项目中包含所需的框架,您在其中一个包含的头文件中引用了该框架。

So, for example, if you an have an include in your code:

因此,例如,如果您的代码中有一个包含:

#import <Parse/Parse.h>

It probably requires a supporting framework, and you have to include it in your app. Did you include the parse.frameworkfrom within Xcode?

它可能需要一个支持框架,并且您必须将其包含在您的应用程序中。您是否parse.framework在 Xcode 中包含了from ?

Xcode Frameworks

Xcode 框架

回答by Marcio Arantes

I had the same use and and the only third party I had was the PayPal SDK. After removing -ObjC everything built fine. (always make a backup of you project before changing settings)

我有同样的用途,唯一的第三方是 PayPal SDK。删除 -ObjC 后一切正常。(在更改设置之前始终备份您的项目)