MonoTouch Build: ld: symbol (s) not found for armv7 architecture

I have a MonoTouch project that builds and works fine on i386 / iOS Simulator. The project references the native (Obj-C) library, which I converted to the MonoTouch library using the btouch process, as described in the Xamarin BindingSample:

https://github.com/xamarin/monotouch-samples/tree/eb640165f0485ff59b2f80e73ccff382bf4f2083/BindingSample/src/binding

So, my makefile creates all three architectures (i386, armv6 and armv7), then combines the three outputs into one โ€œuniversalโ€ library and finally uses btouch to generate the MonoTouch library.

To ensure that my universal library contains all three architectures, I checked with lipo -info , and indeed, it contains i386, armv6 and armv7.

However, when I create for deployment on a real iOS device, I get the following errors:

 Undefined symbols for architecture armv7: "_ABAddressBookCreate", referenced from: -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_ABAddressBookCopyArrayOfAllPeople", referenced from: -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_ABAddressBookGetPersonCount", referenced from: -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_ABRecordCopyValue", referenced from: -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_kABPersonFirstNameProperty", referenced from: -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_kABPersonLastNameProperty", referenced from: -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) -[ContactsTokenField setupSms] in libContactsTokenFieldViewUniversal.a(ContactsTokenField.o) -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_ABMultiValueGetCount", referenced from: -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_ABMultiValueCopyLabelAtIndex", referenced from: -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_ABMultiValueCopyValueAtIndex", referenced from: -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_kABPersonEmailProperty", referenced from: -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) "_kABPersonPhoneProperty", referenced from: -[TITokenFieldView setupWithAddressType:prompt:] in libContactsTokenFieldViewUniversal.a(TITokenField.o) ld: symbol(s) not found for architecture armv7 collect2: ld returned 1 exit status mtouch exited with code 1 

What am I doing wrong?

+6
source share
1 answer

found the problem: the native library depended on the AddressBook structure, and I forgot to include it in the AssemblyInfo.cs of the API definition project:

 [assembly: LinkWith ("libContactsTokenFieldViewUniversal.a", LinkTarget.Simulator | LinkTarget.ArmV6 | LinkTarget.ArmV7, ForceLoad = true, Frameworks="AddressBook Foundation")] 
+8
source

Source: https://habr.com/ru/post/918493/


All Articles