kivy / kivy-ios

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

Added `kivymd` recipe #727

Closed Neizvestnyj closed 1 year ago

Neizvestnyj commented 2 years ago

I added a recipe for kivymd, but during the test build I get an error. For some reason, the .kv files were not added to the root/lib/site-packages/kivymd folder. Is it related to the library itself and is my recipe correct? Work fine if I use:

toolchain build python3 kivy pillow
toolchain pip install https://github.com/kivymd/KivyMD/archive/master.zip

Got dlopen error on Foundation: dlopen(/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 0x0001): tried: '/Users/neizvestnyj/Library/Developer/Xcode/DerivedData/test-ayrowqcxwpoomwbqlsurwrjgejyp/Build/Products/Debug-iphonesimulator/Foundation.framework/Versions/Current/Foundation' (no such file), '/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' (no such file), '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (no such file), '/Users/neizvestnyj/Library/Developer/Xcode/DerivedData/test-ayrowqcxwpoomwbqlsurwrjgejyp/Build/Products/Debug-iphonesimulator/Foundation.framework/Versions/C/Foundation' (no such file), '/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' (no such file), '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation' (no such file) Got fallback dlopen error on Foundation: dlopen(/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 0x0001): tried: '/Users/neizvestnyj/Library/Developer/Xcode/DerivedData/test-ayrowqcxwpoomwbqlsurwrjgejyp/Build/Products/Debug-iphonesimulator/Foundation.framework/Versions/Current/Foundation' (no such file), '/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' (no such file), '/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (no such file), '/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation' (no such file) Traceback (most recent call last): File "/Users/neizvestnyj/PycharmProjects/StyleTransfer/ios/test-ios/YourApp/main.py", line 4, in File "/Users/neizvestnyj/Library/Developer/CoreSimulator/Devices/88558936-C87E-4DF7-AC85-B9EAB3D5FC23/data/Containers/Bundle/Application/E5C06297-C6A4-4AD4-8986-ACF1FB2F0A66/test.app/lib/python3.9/site-packages/kivymd/uix/button/init.py", line 2, in from .button import ( File "/Users/neizvestnyj/Library/Developer/CoreSimulator/Devices/88558936-C87E-4DF7-AC85-B9EAB3D5FC23/data/Containers/Bundle/Application/E5C06297-C6A4-4AD4-8986-ACF1FB2F0A66/test.app/lib/python3.9/site-packages/kivymd/uix/button/button.py", line 517, in from kivymd.uix.label import MDLabel File "/Users/neizvestnyj/Library/Developer/CoreSimulator/Devices/88558936-C87E-4DF7-AC85-B9EAB3D5FC23/data/Containers/Bundle/Application/E5C06297-C6A4-4AD4-8986-ACF1FB2F0A66/test.app/lib/python3.9/site-packages/kivymd/uix/label/init.py", line 1, in from .label import MDIcon, MDLabel # NOQA F401 File "/Users/neizvestnyj/Library/Developer/CoreSimulator/Devices/88558936-C87E-4DF7-AC85-B9EAB3D5FC23/data/Containers/Bundle/Application/E5C06297-C6A4-4AD4-8986-ACF1FB2F0A66/test.app/lib/python3.9/site-packages/kivymd/uix/label/label.py", line 256, in with open( FileNotFoundError: [Errno 2] No such file or directory: '/Users/neizvestnyj/Library/Developer/CoreSimulator/Devices/88558936-C87E-4DF7-AC85-B9EAB3D5FC23/data/Containers/Bundle/Application/E5C06297-C6A4-4AD4-8986-ACF1FB2F0A66/test.app/lib/python3.9/site-packages/kivymd/uix/label/label.kv'

Neizvestnyj commented 1 year ago

I remind that we had something similar for requests on python-for-android, but we later removed it via kivy/python-for-android#1387

kivymd is a plain-python package, and doesn't need a recipe.

But there's also a difference in how kivy-ios and python-for-android are managing pip installable packages:

  • python-for-android doesn't resolve all the sub-dependencies, and the users are required to do some work on their own in order to include all the dependencies in their requirements.
  • kivy-ios resolves all the sub-dependencies, which means that pip also installs dependencies that need a recipe. (Like pillow).

If kivy-ios resolve all dependences, we dont need recipe