kivy/kivy-ios

libzbar recipe missing libiconv dependency

RobertFlatt opened this issue · 9 comments

Versions

  • Python : 3.9.9
  • MacOS version : 11.6.3
  • XCode Version : 13.2.1
  • Cython version :0.29.28
  • kivy-ios : master

Describe the bug
The "play" step in Xcode fails with a link error.

To Reproduce

toolchain distclean
toolchain build python3 kivy
toolchain build libzbar
toolchain create xxx yyy
open xxx-ios/xxx.xcodeproj
"press play"

Expected behavior

The failed link apperars due to an unknown missing assembler library. This should be included in the xcodeproj files, as is the case for other library dependencies.

Logs

Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
      _qr_code_data_list_extract_text in libzbar.a(libzbar_la-qrdectxt.o)
     (maybe you meant: _SDL_iconv_open, _SDL_iconv_close , _SDL_iconv_string , _SDL_iconv )
  "_iconv_close", referenced from:
      _qr_code_data_list_extract_text in libzbar.a(libzbar_la-qrdectxt.o)
     (maybe you meant: _SDL_iconv_close)
  "_iconv_open", referenced from:
      _qr_code_data_list_extract_text in libzbar.a(libzbar_la-qrdectxt.o)
     (maybe you meant: _SDL_iconv_open)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Additional context
A Google search suggests "adding Accelerate"
Looking in the project.pbxproj file we see Accelerate exists in the same group as libkivy.a
However the "Accelerate" option does not appear to exist on Xcode 13 UI.
Speculation : Perhaps the library name has changed?

Further investigation indicates a missing libzbar recipe dependency on libiconv which presumably accounts for the message Undefined symbols for architecture x86_64: "_iconv"

The dependency can be seen in the p4a recipe:

https://github.com/kivy/python-for-android/blob/develop/pythonforandroid/recipes/libzbar/__init__.py#L15 

But not in the kivy-ios recipe:

https://github.com/kivy/kivy-ios/blob/master/kivy_ios/recipes/libzbar/__init__.py#L12

There is no kivy-ios libiconv recipe. So possibly the issue is a missing Xcode link flag?

misl6 commented

Did you try to add libiconv.tbd from "Frameworks, Libraries and Embedded Content" in Xcode?

PS: if this fixes the issue, please don't close the issue, cause kivy-ios should add by itself the library when creating/updating the Xcode project.

Thank you, that linked.

Did you try to add libiconv.tbd from "Frameworks, Libraries and Embedded Content" in Xcode?

PS: if this fixes the issue, please don't close the issue, cause kivy-ios should add by itself the library when creating/updating the Xcode project.

A have the same issue on macOS 12.3. It does not work for me
Screenshot 2022-03-26 at 00 34 17

I had to poke at xcode a few times to do what one press should have done :(

Also I saw this next #681

Is there any way to fix this bug now?

The magic technique in Xcode is to search for libiconv.tbd , click on it to select it, then double click. It will then appear in the list. Do NOT click on add this does not work.

Ah, yes I fixed it: Build Phases > Link Binary With Libraries, then press plus, search ibiconv.tbd, double click on the element (a little reminder for those who come here).

But I get same error: https://stackoverflow.com/questions/71697480/error-in-libffi-when-building-project-in-xcode

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further.