Google Authenticator for iOS Missing Files

461 views Asked by At

I have cloned the Google Authenticator source code from here. After opening the iOS project in Xcode, I realized that a lot of files are missing, thus resulting in hundreds of compilation errors when I try to build. Just a few of the missing files are:

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

Has anyone been able to build the iOS project for Google Authenticator?

UPDATE (June 29, 2015)

I was able to find the missing ZXing files here and the missing Google Toolbox for Mac files here. Then, I ran into a build error in OTPAuthURLEntryController.m at this line:

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

I fixed it by changing the line to:

@property (nonatomic, retain) dispatch_queue_t queue;

Now I'm trying to fix the following "symbol(s) not found" issue:

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)

I've searched all over SO but still haven't figured it out yet. Any help would be greatly appreciated!

1

There are 1 answers

0
Alexander On BEST ANSWER

I was able to find the missing ZXing files here and the missing Google Toolbox for Mac files here. I then added the appropriate missing files to the project. After this, I ran into a build error in OTPAuthURLEntryController.m at this line:

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

I fixed it by changing the line to:

@property (nonatomic, retain) dispatch_queue_t queue;

After that, I ran into the following "symbol(s) not found" error message:

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)

It turns out that the main project (OTPAuth) is linking to a library called libZXingWidget.a, which is missing (like many other things). I opened up the ZXingWidget project in the missing ZXing files and fixed the build errors by removing the custom flags that treated warnings as errors. Then, I built the static library and set the build target to iOS Device. This generated the libZXingWidget.a file I needed. I linked that file in the Build Phases of the main project (OTPAuth), and now Google Authenticator runs on the iPhone 6 simulator!