Kivy project could run by executing main.py but could not build after exported to Xcode project

88 views
Skip to first unread message

timcoda

unread,
May 16, 2020, 9:00:44 PM5/16/20
to Kivy users support
Hi all,

I have a project that process pdf files and it depends on python libs like PyPDF2 and pdfminer.six.
I have tried the project running main.py and it works as expected.
However, after I exported the project to Xcode, the Xcode project could not build.

The project complained with the following error:

rsync error: received SIGINT, SIGTERM, or SIGHUP (code 20) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-54/rsync/rsync.c(244) [sender=2.6.9]

Command /bin/sh failed with exit code 20


Do anyone know what went wrong?
Thanks!
Message has been deleted

ZenCODE

unread,
May 17, 2020, 9:39:40 AM5/17/20
to Kivy users support
Looks like there is a problem running the `sync` command that pulls your code into XCode. What was the exact command you entered to create the project? And the folder you pointed to, is that just a normal folder? Not a symlink or mounted volume?

timcoda

unread,
May 18, 2020, 1:34:26 AM5/18/20
to Kivy users support
Thanks for the response! I create the app using toolchain create app-name proj-dir. I am thinking this may related to the file resources issue as the python code would process on a embeded PDF file currently.
Does anyone know any good reference project for kivy accessing iOS file directory or communicate with native iOS?

ZenCODE

unread,
May 20, 2020, 4:15:46 PM5/20/20
to Kivy users support
Let's not jump to conclusions. Start with a simple test app that just shows a button. Get this running in XCode and then take it from there....
Message has been deleted
Message has been deleted

timcoda

unread,
May 23, 2020, 7:39:35 AM5/23/20
to Kivy users support
Thanks for the response and sorry for the late reply. I've just resumed my journey on Kivy.

I've encountered another problem which from the error log it's related to python3 ipaddress module, the error message is exactly the same on this thread: https://github.com/pypa/pip/issues/7214
On updating python3 modules and cleaning, rebuilding for several times, suddenly I could build the Xcode project successfully.

However, on running the app on my device, I got another error: 

ModuleNotFoundError: No module named 'pdfminer'


While I could successfully run this Kivy app using python3 main.py, when exported to Xcode and run, it complains that some of the used module are not found.

Does anyone know how to fix this?


Thanks a lot for helping!

- show quoted text -

timcoda

unread,
May 23, 2020, 9:04:04 AM5/23/20
to Kivy users support
The "ModuleNotFound" issue seems gone after running toolchain pip3 install for the used modules.
Now I got the error :
 OSError: Cannot load native module 'Crypto.Cipher._raw_ecb': Trying '_raw_ecb.cpython-38-darwin.so': dlopen(/private/var/containers/Bundle/Application/6D0FAA5F-DE71-4C32-AE2B-5FF76B5BA036/testapp.app/lib/python3.8/site-packages/Crypto/Cipher/_raw_ecb.cpython-38-darwin.so, 6): no suitable image found.  Did find:
  /private/var/containers/Bundle/Application/6D0FAA5F-DE70-4C32-AE2B-5FF76B5BA036/testapp.app/lib/python3.8/site-packages/Crypto/Cipher/_raw_ecb.cpython-38-darwin.so: mach-o, but wrong architecture
  /private/var/containers/Bundle/Application/6D0FAA5F-DE70-4C32-AE2B-5FF76B5BA036/testapp.app/lib/python3.8/site-packages/Crypto/Cipher/_raw_ecb.cpython-38-darwin.so: mach-o, but wrong architecture, Trying '_raw_ecb.abi3.so': dlopen(/private/var/containers/Bundle/Application/6D0FAA5F-DE70-4C32-AE2B-5FF76B5BA036/testapp.app/lib/python3.8/site-packages/Crypto/Cipher/_raw_ecb.abi3.so, 6): image not found, Trying '_raw_ecb.so': dlopen(/private/var/containers/Bundle/Application/6D0FAA5F-DE70-4C32-AE2B-5FF76B5BA036/testapp.app/lib/python3.8/site-packages/Crypto/Cipher/_raw_ecb.so, 6): image not found

Seems like some python lib doesn't have an architect / binary that fit iOS? Does anyone have issue like this?

On Googling I found a related thread, pdfminer was one of the lib that I used.

However, I'm not quite familiar with the pyinstaller and don't know how to apply the hook? 
Does anyone have related experience and could give me some suggestions?

Thanks
Reply all
Reply to author
Forward
0 new messages