ryanw3bb/unity-native-toolkit

symbol(s) not found for architecture armv7

reactivo opened this issue · 2 comments

Hello,

After building my Unity project for iOS and opening the project with XCode, I cannot archive it. It gives me this error:

ld: warning: ignoring file /Users/diego.enterria/Documents/Diego/PizzaHut/Builds/iOS/dealjacker-ios-0.97(3)/Libraries/Plugins/iOS/libNativeToolkit.a, file was built for archive which is not the architecture being linked (armv7): /Users/diego.enterria/Documents/Diego/PizzaHut/Builds/iOS/dealjacker-ios-0.97(3)/Libraries/Plugins/iOS/libNativeToolkit.a Undefined symbols for architecture armv7: "_getLongitude", referenced from: _NativeToolkit_getLongitude_m268E7A098A8CA3A317A6431E5E96A880836F50D8 in Bulk_Assembly-CSharp_1.o _NativeToolkit_GetLongitude_mA181252E7B028AD1E11B72621523EE0146194E8F in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_getLongitude_m268E7A098A8CA3A317A6431E5E96A880836F50D8) "_getLatitude", referenced from: _NativeToolkit_getLatitude_mED3C71C44FFF90BC7B2506B49E4A533BD62BA683 in Bulk_Assembly-CSharp_1.o _NativeToolkit_GetLatitude_m5A19A6BD868A74C912EAADFCB20E0538085C7047 in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_getLatitude_mED3C71C44FFF90BC7B2506B49E4A533BD62BA683) "_clearAllLocalNotifications", referenced from: _NativeToolkit_clearAllLocalNotifications_m7A9B2045DE25AFD50C9BB05A8455DE42753E4136 in Bulk_Assembly-CSharp_1.o _NativeToolkit_ClearAllLocalNotifications_mC09F8560EF08395DA73F2D9A0C83F9BCDA124DCE in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_clearAllLocalNotifications_m7A9B2045DE25AFD50C9BB05A8455DE42753E4136) "_scheduleLocalNotification", referenced from: _NativeToolkit_scheduleLocalNotification_m46AC5DEBB102996C378723FCBD121F1ED29C3EE1 in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_scheduleLocalNotification_m46AC5DEBB102996C378723FCBD121F1ED29C3EE1) "_rateApp", referenced from: _NativeToolkit_rateApp_m53CAAF0804B6DF18F8AA140F3C717553937431B7 in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_rateApp_m53CAAF0804B6DF18F8AA140F3C717553937431B7) "_openCamera", referenced from: _NativeToolkit_openCamera_mA0741054C4F79084B8551F304FE5798F18F08BCB in Bulk_Assembly-CSharp_1.o _NativeToolkit_TakeCameraShot_m34F41271F96EDF8AA00CAFAC87522FE244FE30AA in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_openCamera_mA0741054C4F79084B8551F304FE5798F18F08BCB) "_clearLocalNotification", referenced from: _NativeToolkit_clearLocalNotification_m318A26768F2F63BEB56F767FD66ABDA8CD9391C3 in Bulk_Assembly-CSharp_1.o _NativeToolkit_ClearLocalNotification_m751B22DBFCF1089D86000BCC552B83489EE70C9B in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_clearLocalNotification_m318A26768F2F63BEB56F767FD66ABDA8CD9391C3) "_getLocale", referenced from: _NativeToolkit_getLocale_mD2DF9E39E6850D9488DE11FE02409B275F6A0631 in Bulk_Assembly-CSharp_1.o _NativeToolkit_GetCountryCode_m7601FB57E6D168A0C3371D47C60EFF664896DAAF in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_getLocale_mD2DF9E39E6850D9488DE11FE02409B275F6A0631) "_showAlert", referenced from: _NativeToolkit_showAlert_m18D261B65563F73A692A5D4B01DA3947D2146B5F in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_showAlert_m18D261B65563F73A692A5D4B01DA3947D2146B5F) "_pickContact", referenced from: _NativeToolkit_pickContact_mFBD4409625086444C30E4ABE7282BDAF420F3B1F in Bulk_Assembly-CSharp_1.o _NativeToolkit_PickContact_m6D0CFE4F7534C811CD5E39BCCE255D9EE8FD121E in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_pickContact_mFBD4409625086444C30E4ABE7282BDAF420F3B1F) "_showConfirm", referenced from: _NativeToolkit_showConfirm_mB86E3D656B38FD02B4E2FBF493542281AC78D25E in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_showConfirm_mB86E3D656B38FD02B4E2FBF493542281AC78D25E) "_pickImage", referenced from: _NativeToolkit_pickImage_m6767EE3FC42C04BD005A9AF200393CE16711EDB7 in Bulk_Assembly-CSharp_1.o _NativeToolkit_PickImage_m64E12E2A93456794B1BA63A77AE5B5538216302F in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_pickImage_m6767EE3FC42C04BD005A9AF200393CE16711EDB7) "_wasLaunchedFromNotification", referenced from: _NativeToolkit_wasLaunchedFromNotification_m4469F52AD5E20A6EDAAA22BD1773C5F603B11EF3 in Bulk_Assembly-CSharp_1.o _NativeToolkit_WasLaunchedFromNotification_m93487BDE1D1E4C85372FB1D6EE44B35877D48230 in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_wasLaunchedFromNotification_m4469F52AD5E20A6EDAAA22BD1773C5F603B11EF3) "_sendEmail", referenced from: _NativeToolkit_sendEmail_m91020CE4C014F54E9CB8CCF6958BB759D942B33B in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_sendEmail_m91020CE4C014F54E9CB8CCF6958BB759D942B33B) "_startLocation", referenced from: _NativeToolkit_startLocation_m99B82710F4570A1B723205C75DB56BDD718B317A in Bulk_Assembly-CSharp_1.o _NativeToolkit_StartLocation_m75A66CAE6DA7B590C8038BC66E3C78EE84E063C5 in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_startLocation_m99B82710F4570A1B723205C75DB56BDD718B317A) "_saveToGallery", referenced from: _NativeToolkit_saveToGallery_m71C62182A7610FF5FDE443E5C4FA7C6BEBE4164E in Bulk_Assembly-CSharp_1.o _U3CSaveU3Ed__50_MoveNext_m1F71AAF1524B5C144ECA8FA678121C11C668A4BF in Bulk_Assembly-CSharp_1.o (maybe you meant: _NativeToolkit_saveToGallery_m71C62182A7610FF5FDE443E5C4FA7C6BEBE4164E) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I select my iPhone X as a target device and press play it installs without any errors into the phone, though.

Any clues on what can I do to make archiving work?

Thank you.

I had exactly the same problem, it looks like the libNativeToolkit.a file was built for arm64 only for some reason, so any builds including armv7 wouldn't work.

I cloned the repo and re-built the file through Xcode using the source files, and this version includes both arm64 and armv7. This is my first time generating one of these libraries, so there's a chance I could have done something wrong, but from my own testing, it seems to be working fine! I'm only using the plugin for native notifications, so I'm not sure about the other functionality, but I imagine if those are working, the rest of the plugin should work fine as well.

Download and extract this file: libNativeToolkit.a.zip and use it to replace the one in the Assets/Plugins/iOS folder in your Unity project, and it should then work with both arm64 and armv7.

Have reverted back to using uncompiled classes for iOS instead of a static lib, so this issue should be fixed on the main branch.