Search code examples
iosxcodeunity-game-enginearm64il2cpp

Unity 4.6.6 Xcode 'Undefined symbol for armv7/arm64 architecture' linker errors


I've been building my Xcode project with Unity 4.6.6 and I've been having problems with IL2CPP. I select Universal architecture in the Player settings (to include both armv7 and arm64) when building, and in the Xcode project it generates, upon building I encounter the following Mach-O Linker errors.

Undefined symbols for architecture armv7: "_sqlite3_bind_int", referenced from: -[SmacBaseDao setSqlBindStatement:entity:colmunInfoList:emptyIsNull:] in libSmacTracking.a(SmacBaseDao.o) "_sqlite3_errmsg", referenced from: -[SmacBaseDao execSelectQuery:condition:colmun:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execInsertQuery:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execUpdateQuery:condition:emptyIsNull:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getColmunsInfo:transactionDbObj:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getTableList] in libSmacTracking.a(SmacBaseDao.o) "_sqlite3_column_int", referenced from: -[SmacBaseDao getNumber:column:] in libSmacTracking.a(SmacBaseDao.o) "_sqlite3_open", referenced from: -[SmacBaseDao dbOpen] in libSmacTracking.a(SmacBaseDao.o) "_sqlite3_exec", referenced from: -[SmacBaseDao dbOpen] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao dbClose:] in libSmacTracking.a(SmacBaseDao.o) "_OBJC_CLASS_$_NSManagedObjectModel", referenced from: objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o) "_sqlite3_prepare_v2", referenced from: -[SmacUpdate updateDB] in libSmacTracking.a(SmacUpdate.o) -[SmacBaseDao dbOpen] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execSelectQuery:condition:colmun:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execInsertQuery:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execUpdateQuery:condition:emptyIsNull:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getColmunsInfo:transactionDbObj:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getTableList] in libSmacTracking.a(SmacBaseDao.o) ... "_sqlite3_step", referenced from: -[SmacUpdate updateDB] in libSmacTracking.a(SmacUpdate.o) -[SmacBaseDao dbOpen] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execSelectQuery:condition:colmun:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execInsertQuery:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execUpdateQuery:condition:emptyIsNull:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getColmunsInfo:transactionDbObj:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getTableList] in libSmacTracking.a(SmacBaseDao.o) ... "_sqlite3_column_text", referenced from: -[SmacBaseDao getString:column:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getDateString:column:] in libSmacTracking.a(SmacBaseDao.o) "_sqlite3_finalize", referenced from: -[SmacUpdate updateDB] in libSmacTracking.a(SmacUpdate.o) -[SmacBaseDao dbOpen] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execSelectQuery:condition:colmun:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execInsertQuery:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execUpdateQuery:condition:emptyIsNull:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao getColmunsInfo:transactionDbObj:] in libSmacTracking.a(SmacBaseDao.o) "_OBJC_CLASS_$_NSEntityDescription", referenced from: objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o) objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o) "_OBJC_CLASS_$_NSManagedObjectContext", referenced from: objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o) "_OBJC_CLASS_$_NSPersistentStoreCoordinator", referenced from: objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o) "_kSecReturnData", referenced from: -[KeychainItemWrapper secItemFormatToDictionary:] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_kSecMatchLimitOne", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o "_kSecMatchLimit", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o "_OBJC_CLASS_$_NSFetchRequest", referenced from: objc-class-ref in libGoogleAnalyticsServices.a(GAIDataStore.o) "_NSOverwriteMergePolicy", referenced from: -[GAIDataStore contextWithModel:URL:] in libGoogleAnalyticsServices.a(GAIDataStore.o) "_sqlite3_reset", referenced from: -[SmacBaseDao execInsertQuery:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) -[SmacBaseDao execUpdateQuery:condition:emptyIsNull:transactionDbObj:isTmp:] in libSmacTracking.a(SmacBaseDao.o) "_kSecClassGenericPassword", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o -[KeychainItemWrapper dictionaryToSecItemFormat:] in KeychainItemWrapper.o -[KeychainItemWrapper secItemFormatToDictionary:] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_OBJC_CLASS_$_NSAttributeDescription", referenced from: objc-class-ref in libGoogleAnalyticsServices.a(GAICoreDataUtil.o) "_kSecAttrService", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_kSecAttrLabel", referenced from: -[KeychainItemWrapper resetKeychainItem] in KeychainItemWrapper.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o "_NSSQLiteStoreType", referenced from: -[GAIDataStore coordinatorWithModel:URL:] in libGoogleAnalyticsServices.a(GAIDataStore.o) "_NSSQLiteErrorDomain", referenced from: -[GAIDataStore performBlockAndWait:withError:] in libGoogleAnalyticsServices.a(GAIDataStore.o) "_sqlite3_bind_null", referenced from: -[SmacBaseDao setSqlBindStatement:entity:colmunInfoList:emptyIsNull:] in libSmacTracking.a(SmacBaseDao.o) "_kSecClass", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o -[KeychainItemWrapper dictionaryToSecItemFormat:] in KeychainItemWrapper.o -[KeychainItemWrapper secItemFormatToDictionary:] in KeychainItemWrapper.o -[KeychainItemWrapper writeToKeychain] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o ... "_kSecAttrGeneric", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o "_kSecAttrAccount", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_kSecValueData", referenced from: -[KeychainItemWrapper resetKeychainItem] in KeychainItemWrapper.o -[KeychainItemWrapper dictionaryToSecItemFormat:] in KeychainItemWrapper.o -[KeychainItemWrapper secItemFormatToDictionary:] in KeychainItemWrapper.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o "_kSecAttrAccessGroup", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_SecItemUpdate", referenced from: -[KeychainItemWrapper writeToKeychain] in KeychainItemWrapper.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o "_OBJC_CLASS_$_SKProductsRequest", referenced from: objc-class-ref in AppStoreProcess.o "_sqlite3_bind_text", referenced from: -[SmacBaseDao setSqlBindStatement:entity:colmunInfoList:emptyIsNull:] in libSmacTracking.a(SmacBaseDao.o) "_SecItemCopyMatching", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o -[KeychainItemWrapper secItemFormatToDictionary:] in KeychainItemWrapper.o -[KeychainItemWrapper writeToKeychain] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_sqlite3_close", referenced from: -[SmacBaseDao dbClose:] in libSmacTracking.a(SmacBaseDao.o) "_SecItemAdd", referenced from: -[KeychainItemWrapper writeToKeychain] in KeychainItemWrapper.o +[KeychainUtils setValue:key:servicename:accessGroup:force:errorDomain:error:] in KeychainUtils.o "_SecItemDelete", referenced from: -[KeychainItemWrapper resetKeychainItem] in KeychainItemWrapper.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_OBJC_CLASS_$_SKPayment", referenced from: objc-class-ref in AppStoreProcess.o "_kSecReturnAttributes", referenced from: -[KeychainItemWrapper initWithIdentifier:serviceName:accessGroup:] in KeychainItemWrapper.o +[KeychainUtils getStoredValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o +[KeychainUtils deleteValue:serviceName:accessGroup:errorDomain:error:] in KeychainUtils.o "_kSecAttrDescription", referenced from: -[KeychainItemWrapper resetKeychainItem] in KeychainItemWrapper.o "_OBJC_CLASS_$_SKPaymentQueue", referenced from: objc-class-ref in AppStoreProcess.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've read some questions with answers regarding "Undefined symbols for architecture armv7" like this one but the suggested solutions in the top answer doesn't really apply because in my case it's Unity that places the needed files into the Xcode Project folder. Also, upon inspection the libraries the errors were looking for were properly added in the Link Binary With Libraries section of Build Phases.

Can anyone help or enlighten me if I'm doing something wrong?

I've also tried selecting in Unity Player settings just armv7 or just arm64 for building with IL2CPP but I still get "Undefined symbols for armv7" or "Undefined symbols for arm64" Mach-O Linker errors respectively in Xcode.

Software used: Unity 4.6.6, Xcode 6.1 (going to try upgrading to 6.3), and iOS 8.1 base SDK


Solution

  • Look if libsqlite3.dylib is added to all your targets.