1

我已经从这里克隆了 Google Authenticator 源代码。在 Xcode 中打开 iOS 项目后,我发现很多文件丢失了,因此在我尝试构建时导致了数百个编译错误。只有一些丢失的文件是:

GTMNSDictionary+URLArguments.h
GTMNSString+URLArguments.h
GTMLocalizedString.h
GTMRegex.h

有没有人能够为 Google Authenticator 构建 iOS 项目?

更新(2015 年 6 月 29 日)

我能够在这里找到丢失的 ZXing 文件丢失的 Google Toolbox for Mac 文件。然后,我在这一行遇到了构建错误:OTPAuthURLEntryController.m

@property (nonatomic, retain) __attribute__((NSObject)) dispatch_queue_t queue;

我通过将行更改为:

@property (nonatomic, retain) dispatch_queue_t queue;

现在我正在尝试解决以下“未找到符号”问题:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Decoder", referenced from:
      objc-class-ref in OTPAuthURLEntryController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经搜索了所有内容,但仍然没有弄清楚。任何帮助将不胜感激!

4

1 回答 1

1

我能够在这里找到丢失的 ZXing 文件丢失的 Google Toolbox for Mac 文件。然后我将适当的缺失文件添加到项目中。在此之后,我在这一行遇到了构建错误:OTPAuthURLEntryController.m

@property (nonatomic, retain) __attribute__((NSObject)) dispatch_queue_t queue;

我通过将行更改为:

@property (nonatomic, retain) dispatch_queue_t queue;

之后,我遇到了以下“未找到符号”错误消息:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Decoder", referenced from:
      objc-class-ref in OTPAuthURLEntryController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

事实证明,主项目 ( OTPAuth) 正在链接到一个名为 的库libZXingWidget.a,该库丢失了(就像许多其他东西一样)。我在缺少的 ZXing 文件中打开了ZXingWidget项目,并通过删除将警告视为错误的自定义标志来修复构建错误。然后,我构建了静态库并将构建目标设置为iOS Device。这生成了libZXingWidget.a我需要的文件。我在主项目的 Build Phases ( OTPAuth) 中链接了该文件,现在 Google Authenticator 在 iPhone 6 模拟器上运行!

于 2015-06-30T13:06:16.297 回答