kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
782 stars 240 forks source link

Stuck between two error codes: ImportError...(PyInit__imaging) and 407 duplicate symbols #752

Closed MNwake closed 1 year ago

MNwake commented 1 year ago

I have ran through this at least 100 times now... trying various combinations of builds, orders, while trying different 'fixes' each time... I think i've narrowed down to two errors that prevent me from moving forward.

Also, i've had this same Kivy app build successfully a few weeks ago. Only changes to the app were more screens, no new python libraries.

-->

Versions

To Reproduce first Error

$ cd usr/dev/projects $ git clone https://github.com/kivy/kivy-ios.git $ cd kivy-ios/ $ python3 -m venv venv $ . venv/bin/activate $ pip install -e . $ pip install cython $ toolchain build python3 kivy pillow $ toolchain status

audiostream  - Not built
click        - Not built
curly        - Not built
cymunk       - Not built
ffmpeg       - Not built
ffpyplayer   - Not built
flask        - Not built
freetype     - Build OK (built at 2022-11-15 04:16:58.707553)
host_setuptools - Not built
host_setuptools3 - Build OK (built at 2022-11-15 04:35:28.742929)
hostopenssl  - Build OK (built at 2022-11-15 04:18:11.112986)
hostpython3  - Build OK (built at 2022-11-15 04:28:05.637191)
ios          - Build OK (built at 2022-11-15 04:35:43.519411)
itsdangerous - Not built
jinja2       - Not built
kivent_core  - Not built
kivy         - Build OK (built at 2022-11-15 04:41:37.035634)
libcurl      - Not built
libffi       - Build OK (built at 2022-11-15 04:20:59.996058)
libjpeg      - Build OK (built at 2022-11-15 04:21:38.399225)
libpng       - Not built
libzbar      - Not built
markupsafe   - Not built
netifaces    - Not built
numpy        - Not built
openssl      - Build OK (built at 2022-11-15 04:23:50.211809)
photolibrary - Not built
pillow       - Build OK (built at 2022-11-15 04:42:27.446835)
plyer        - Not built
py3dns       - Not built
pycrypto     - Not built
pykka        - Not built
pyobjus      - Build OK (built at 2022-11-15 04:36:40.557163)
python3      - Build OK (built at 2022-11-15 04:35:23.642768)
pyyaml       - Not built
sdl2         - Build OK (built at 2022-11-15 04:24:49.676846)
sdl2_image   - Build OK (built at 2022-11-15 04:28:21.407035)
sdl2_mixer   - Build OK (built at 2022-11-15 04:28:35.747256)
sdl2_ttf     - Build OK (built at 2022-11-15 04:29:49.730854)
werkzeug     - Not built
zbarlight    - Not built

$ toolchain pip list

[DEBUG   ] Package    Version
[DEBUG   ] ---------- ----------
[DEBUG   ] certifi    2022.9.24
[DEBUG   ] ios        1.1
[DEBUG   ] Kivy       2.2.0.dev0
[DEBUG   ] Pillow     8.2.0
[DEBUG   ] pip        21.2.4
[DEBUG   ] pyobjus    1.2.2.dev0
[DEBUG   ] setuptools 58.1.0

$ toolchain create myapp /usr/dev/projects/company/app $ open myapp-ios/myapp.xcodeproj/

In Xcode

CMD + SHIFT + K : Clean Successful

target -> signing and capabilities : Set Team

Run app.

Build Fail

error:

ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/Metal.framework/Metal.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/Accelerate.framework/Accelerate.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreHaptics.framework/CoreHaptics.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/WebKit.framework/WebKit.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreBluetooth.framework/CoreBluetooth.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreMedia.framework/CoreMedia.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreMotion.framework/CoreMotion.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/MessageUI.framework/MessageUI.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/AVFoundation.framework/AVFoundation.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreVideo.framework/CoreVideo.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/ImageIO.framework/ImageIO.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/GameController.framework/GameController.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libz.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/Photos.framework/Photos.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libbz2.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libsqlite3.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libc++.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libobjc.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libSystem.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/AVFAudio.framework/AVFAudio.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/AVFCapture.framework/AVFCapture) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/AVFCore.framework/AVFCore) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/AudioToolboxCore.framework/AudioToolboxCore) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/CoreServices.framework/CoreServices.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/System/Library/Frameworks/FileProvider.framework/FileProvider.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/DocumentManager.framework/DocumentManager) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/PrintKitUI.framework/PrintKitUI) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/ShareSheet.framework/ShareSheet) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/UIKitCore.framework/UIKitCore) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/WebKitLegacy.framework/WebKitLegacy) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libcache.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libcommonCrypto.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libcompiler_rt.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libcopyfile.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libcorecrypto.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libdispatch.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libdyld.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libmacho.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libremovefile.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_asl.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_blocks.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_c.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_collections.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_configuration.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_containermanager.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_coreservices.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_darwin.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_dnssd.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_featureflags.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_info.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_m.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_malloc.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_networkextension.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_notify.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sandbox.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sim_kernel.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sim_platform.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sim_pthread.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_trace.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libunwind.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libxpc.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.1.sdk/usr/lib/libc++abi.tbd) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBNNS.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLinearAlgebra.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libQuadrature.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparse.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libSparseBLAS.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvMisc.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/CollectionViewCore.framework/CollectionViewCore) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sim_kernel_host.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sim_platform_host.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_sim_pthread_host.dylib) built for iOS Simulator
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_kernel.dylib) built for macOS/Mac Catalyst
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_platform.dylib) built for macOS/Mac Catalyst
ld: warning: building for iOS, but linking in .tbd file (/usr/lib/system/libsystem_pthread.dylib) built for macOS/Mac Catalyst
duplicate symbol '_FT_Get_BDF_Charset_ID' in:
    /Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/lib/libfreetype.a(ftbdf.o)
    /Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/lib/libsdl2_ttf.a(ftbdf.o)
duplicate symbol '_FT_Get_BDF_Property' in:
    /Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/lib/libfreetype.a(ftbdf.o)
    /Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/lib/libsdl2_ttf.a(ftbdf.o)
... 
// this repeats, always the same two files 
....
duplicate symbol '_FTC_SBitCache_New' in:
    /Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/lib/libfreetype.a(ftcache.o)
    /Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/lib/libsdl2_ttf.a(ftcache.o)
ld: 407 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've done a lot of research on this, can't find anything that relates to kivy. I tried to delete either one of those files and neither fixed the problem. I'm not familiar with xcode and new to programming so if this is an obvious fix I apologize in advance for wasting your time lol... I didn't see anything about this in issues either.

Expected behavior These three builds alone shouldn't have any error. It should prompt me with a module not found error looking for Kivymd, Pandas, etc to install through toolchain pip install

To Reproduce other Error

$ cd usr/dev/projects $ git clone https://github.com/kivy/kivy-ios.git $ cd kivy-ios/ $ python3 -m venv venv $ . venv/bin/activate $ pip install -e . $ pip install cython $ toolchain build python3 kivy $ toolchain pip install kivymd $ toolchain status

audiostream  - Not built
click        - Not built
curly        - Not built
cymunk       - Not built
ffmpeg       - Not built
ffpyplayer   - Not built
flask        - Not built
freetype     - Not built
host_setuptools - Not built
host_setuptools3 - Build OK (built at 2022-11-15 07:22:16.960791)
hostopenssl  - Build OK (built at 2022-11-15 07:06:20.473683)
hostpython3  - Build OK (built at 2022-11-15 07:15:12.857374)
ios          - Build OK (built at 2022-11-15 07:22:29.949586)
itsdangerous - Not built
jinja2       - Not built
kivent_core  - Not built
kivy         - Build OK (built at 2022-11-15 07:27:38.583888)
libcurl      - Not built
libffi       - Build OK (built at 2022-11-15 07:08:57.115738)
libjpeg      - Not built
libpng       - Not built
libzbar      - Not built
markupsafe   - Not built
netifaces    - Not built
numpy        - Not built
openssl      - Build OK (built at 2022-11-15 07:11:11.841915)
photolibrary - Not built
pillow       - Not built
plyer        - Not built
py3dns       - Not built
pycrypto     - Not built
pykka        - Not built
pyobjus      - Build OK (built at 2022-11-15 07:23:22.322053)
python3      - Build OK (built at 2022-11-15 07:22:12.422587)
pyyaml       - Not built
sdl2         - Build OK (built at 2022-11-15 07:12:10.832230)
sdl2_image   - Build OK (built at 2022-11-15 07:15:27.163816)
sdl2_mixer   - Build OK (built at 2022-11-15 07:15:41.012560)
sdl2_ttf     - Build OK (built at 2022-11-15 07:16:55.338599)
werkzeug     - Not built
zbarlight    - Not built

$ toolchain pip list

[DEBUG   ] Package            Version
[DEBUG   ] ------------------ ----------
[DEBUG   ] certifi            2022.9.24
[DEBUG   ] charset-normalizer 2.1.1
[DEBUG   ] docutils           0.19
[DEBUG   ] idna               3.4
[DEBUG   ] ios                1.1
[DEBUG   ] Kivy               2.2.0.dev0
[DEBUG   ] Kivy-Garden        0.1.5
[DEBUG   ] kivymd             1.1.1
[DEBUG   ] Pillow             9.3.0
[DEBUG   ] pip                21.2.4
[DEBUG   ] Pygments           2.13.0
[DEBUG   ] pyobjus            1.2.2.dev0
[DEBUG   ] requests           2.28.1
[DEBUG   ] setuptools         58.1.0
[DEBUG   ] urllib3            1.26.12

$ toolchain create myapp /location $ open myapp/xcodeproj

In Xcode

CMD + SHIFT + K : Clean Successful

target -> signing and capabilities : Set Team

Run app.

Build Successfull

Installs, then brings up black screen and crashes

2022-11-15 02:33:35.371824-0500 myapp[2401:836449] Available orientation: KIVY_ORIENTATION=LandscapeLeft LandscapeRight Portrait PortraitUpsideDown
2022-11-15 02:33:35.371888-0500 myapp[2401:836449] Initializing python
2022-11-15 02:33:35.436466-0500 myapp[2401:836449] Running main.py: /private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/YourApp/main.pyc
[WARNING] [Config      ] Older configuration version detected (0 instead of 24)
[WARNING] [Config      ] Upgrading configuration in progress.
[INFO   ] [Logger      ] Record log in /private/var/mobile/Containers/Data/Application/0D7745A7-2A9D-45E4-845F-DAE7D022B9A2/Documents/.kivy/logs/kivy_22-11-15_0.txt
[INFO   ] [Kivy        ] v2.2.0.dev0
[INFO   ] [Kivy        ] Installed at "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/lib/python3.9/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.9 (main, Nov 15 2022, 02:21:14) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/myapp"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [KivyMD      ] 1.1.1, git-Unknown, 2022-11-10 (installed at "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/lib/python3.9/site-packages/kivymd/__init__.py")
[INFO   ] [Factory     ] 189 symbols loaded
[INFO   ] [Image       ] Providers: img_imageio, img_tex, img_sdl2 (img_dds, img_ffpyplayer, img_pil ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
2022-11-15 02:33:35.756170-0500 myapp[2401:836449] You need UIApplicationSupportsIndirectInputEvents in your Info.plist for mouse support
2022-11-15 02:33:35.883694-0500 myapp[2401:836449] Metal GPU Frame Capture Enabled
2022-11-15 02:33:35.884590-0500 myapp[2401:836449] Metal API Validation Enabled
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'OpenGL ES 2.0 Metal - 99'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple A14 GPU'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 0
[INFO   ] [GL          ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO   ] [GL          ] Texture max size <4096>
[INFO   ] [GL          ] Texture max units <8>
2022-11-15 02:33:36.001447-0500 myapp[2401:836449] fopen failed for data file: errno = 2 (No such file or directory)
2022-11-15 02:33:36.001560-0500 myapp[2401:836449] Errors found! Invalidating cache...
2022-11-15 02:33:36.012163-0500 myapp[2401:836449] fopen failed for data file: errno = 2 (No such file or directory)
2022-11-15 02:33:36.012232-0500 myapp[2401:836449] Errors found! Invalidating cache...
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
Got dlopen error on Foundation: dlopen(/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 0x0001): tried: '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/private/preboot/Cryptexes/OS/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2, not in dyld cache)
Got fallback dlopen error on Foundation: dlopen(/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 0x0001): tried: '/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/private/preboot/Cryptexes/OS/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2, not in dyld cache)
 Traceback (most recent call last):
   File "<string>", line 44, in load_module
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/root/python3/lib/python3.9/imp.py", line 342, in load_dynamic
   File "<frozen importlib._bootstrap>", line 711, in _load
   File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
   File "<frozen importlib._bootstrap>", line 565, in module_from_spec
   File "<frozen importlib._bootstrap_external>", line 1173, in create_module
   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
 ImportError: dynamic module does not define module export function (PyInit_PIL__imaging)

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/myapp-ios/YourApp/main.py", line 116, in <module>
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/myapp-ios/YourApp/View/screens.py", line 4, in <module>
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/myapp-ios/YourApp/Controller/admin_screen.py", line 3, in <module>
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/myapp-ios/YourApp/View/AdminScreen/admin_screen.py", line 3, in <module>
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/myapp-ios/YourApp/View/AdminScreen/components/Create/Contests/create_contest.py", line 5, in <module>
   File "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/lib/python3.9/site-packages/kivymd/uix/pickers/__init__.py", line 1, in <module>
     from .colorpicker import MDColorPicker  # NOQA F401
   File "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/lib/python3.9/site-packages/kivymd/uix/pickers/colorpicker/__init__.py", line 1, in <module>
     from .colorpicker import MDColorPicker  # NOQA F401
   File "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/lib/python3.9/site-packages/kivymd/uix/pickers/colorpicker/colorpicker.py", line 97, in <module>
     from PIL import Image as PilImage
   File "/private/var/containers/Bundle/Application/E33C15A2-786F-42FA-9DF4-E38BE71E8D94/myapp.app/lib/python3.9/site-packages/PIL/Image.py", line 100, in <module>
     from . import _imaging as core
   File "<string>", line 48, in load_module
   File "/Users/theokoester/dev/projects/TheCWA/kivy-ios/dist/root/python3/lib/python3.9/imp.py", line 342, in load_dynamic
 ImportError: dynamic module does not define module export function (PyInit__imaging)
2022-11-15 02:33:36.265865-0500 myapp[2401:836449] Application quit abnormally!
2022-11-15 02:33:36.281447-0500 myapp[2401:836449] Leaving

So for this error code, i found issue #644 where the solution is to build pillow before toolchain pip install kivymd, but that's what i did in my first attempt.

So now I can try to $ toolchain build pillow and $ toolchain update myapp-ios

rerun app in xcode 407 duplicate error from above

but now I have mismatched versions of Pillow Build: 8.2.0 Pip: 9.3

I fix that, and still 407 duplicates.

So i'm in a circle and can't find my way out. Any help would be greatly appreciated.

MNwake commented 1 year ago

I uninstalled Xcode and reinstalled. That fixed the issue.

MNwake commented 1 year ago

Nevermind, 407 duplicates happened again... I realized if clone from github, i get 407 duplicates, if I pip install kivy-ios i can get a successful build.

407 duplicates (see above)

git clone https://github.com/kivy/kivy-ios.git
cd kivy-ios/
python3 -m venv venv
. venv/bin/activate
pip install -e .
xcode-select --install
pip install cython
brew install autoconf automake libtool pkg-config
brew link libtool
toolchain build python3 kivy pillow numpy
toolchain pip install kivymd dnspython mongoengine watchdog pandas numpy==1.20.2

Build Successful:

python3 -m venv venv
. venv/bin/activate
pip install kivy-ios
xcode-select --install
pip install cython
brew install autoconf automake libtool pkg-config
brew link libtool
toolchain build python3 kivy pillow numpy
toolchain pip install kivymd dnspython mongoengine watchdog pandas numpy==1.20.2

However, This crashes upon open.

2022-11-17 12:03:00.263604-0500 TheCWA[52331:809136] Available orientation: KIVY_ORIENTATION=LandscapeRight Portrait PortraitUpsideDown
2022-11-17 12:03:00.264098-0500 TheCWA[52331:809136] Initializing python
2022-11-17 12:03:00.621087-0500 TheCWA[52331:809136] Running main.py: /Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/YourApp/main.pyc
[INFO   ] [Logger      ] Record log in /Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Data/Application/A64F6AEB-AC00-4499-9C20-ADD591CF231F/Documents/.kivy/logs/kivy_22-11-17_2.txt
[INFO   ] [Kivy        ] v2.2.0.dev0
[INFO   ] [Kivy        ] Installed at "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/kivy/__init__.py"
[INFO   ] [Python      ] v3.9.9 (main, Nov 17 2022, 11:22:15) 
[Clang 14.0.0 (clang-1400.0.29.202)]
[INFO   ] [Python      ] Interpreter at "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/TheCWA"
[INFO   ] [Logger      ] Purge log fired. Processing...
[INFO   ] [Logger      ] Purge finished!
[INFO   ] [Factory     ] 189 symbols loaded
[INFO   ] [Image       ] Providers: img_imageio, img_tex, img_sdl2 (img_dds, img_ffpyplayer, img_pil ignored)
[INFO   ] [KivyMD      ] 1.1.1, git-Unknown, 2022-11-10 (installed at "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/kivymd/__init__.py")
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
[INFO   ] [GL          ] Backend used <sdl2>
[INFO   ] [GL          ] OpenGL version <b'OpenGL ES 2.0 APPLE-20.0.32'>
[INFO   ] [GL          ] OpenGL vendor <b'Apple Inc.'>
[INFO   ] [GL          ] OpenGL renderer <b'Apple Software Renderer'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 0
[INFO   ] [GL          ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO   ] [GL          ] Texture max size <4096>
[INFO   ] [GL          ] Texture max units <8>
[INFO   ] [Window      ] auto add sdl2 input provider
[INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
Got dlopen error on Foundation: dlopen(/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 0x0001): tried: '/Users/tk/Library/Developer/Xcode/DerivedData/thecwa-hfvunietpteksieimavlgfgsfhvi/Build/Products/Debug-iphonesimulator/Foundation.framework/Versions/Current/Foundation' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/Users/tk/Library/Developer/Xcode/DerivedData/thecwa-hfvunietpteksieimavlgfgsfhvi/Build/Products/Debug-iphonesimulator/Foundation.framework/Versions/C/Foundation' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation' (errno=2), '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation' (errno=2)
Got fallback dlopen error on Foundation: dlopen(/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 0x0001): tried: '/Users/tk/Library/Developer/Xcode/DerivedData/thecwa-hfvunietpteksieimavlgfgsfhvi/Build/Products/Debug-iphonesimulator/Foundation.framework/Versions/Current/Foundation' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (errno=2)
 Traceback (most recent call last):
   File "<string>", line 44, in load_module
   File "/Users/tk/thecwa-ios/dist/root/python3/lib/python3.9/imp.py", line 342, in load_dynamic
   File "<frozen importlib._bootstrap>", line 711, in _load
   File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
   File "<frozen importlib._bootstrap>", line 565, in module_from_spec
   File "<frozen importlib._bootstrap_external>", line 1173, in create_module
   File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
 ImportError: dynamic module does not define module export function (PyInit_pandas__libs_interval)

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/Users/tk/thecwa-ios/thecwa-ios/YourApp/main.py", line 123, in <module>
   File "/Users/tk/thecwa-ios/thecwa-ios/YourApp/View/screens.py", line 7, in <module>
   File "/Users/tk/thecwa-ios/thecwa-ios/YourApp/Controller/event_screen.py", line 3, in <module>
   File "/Users/tk/thecwa-ios/thecwa-ios/YourApp/View/EventScreen/event_screen.py", line 3, in <module>
   File "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
     from pandas.compat import is_numpy_dev as _is_numpy_dev
   File "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
     from pandas.compat.numpy import (
   File "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 4, in <module>
     from pandas.util.version import Version
   File "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
     from pandas.util._decorators import (  # noqa:F401
   File "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
     from pandas._libs.properties import cache_readonly  # noqa:F401
   File "/Users/tk/Library/Developer/CoreSimulator/Devices/702F62D4-9CC7-452C-BD05-E7B658E5447F/data/Containers/Bundle/Application/428C477C-23D1-48B8-88D8-437746E2AD19/TheCWA.app/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
     from pandas._libs.interval import Interval
   File "<string>", line 48, in load_module
   File "/Users/tk/thecwa-ios/dist/root/python3/lib/python3.9/imp.py", line 342, in load_dynamic
 ImportError: dynamic module does not define module export function (PyInit_interval)
2022-11-17 12:03:03.742476-0500 TheCWA[52331:809136] Application quit abnormally!
2022-11-17 12:03:03.821300-0500 TheCWA[52331:809136] Leaving
MNwake commented 1 year ago

If I remove pandas from my codebase it builds and runs properly on device... only on the pip install kivy-iOS build