kivy / kivy-ios

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

App runs fine from XCode, but terminates with an error if installed through TestFlight #850

Closed CoderCoderCoder closed 10 months ago

CoderCoderCoder commented 10 months ago

Hello, there is another issue. My small test app runs fine from XCode on any tested iOS device, but it terminates if installed from TestFlight (again - same problem on all tested devices). The error in the kivy.log is the following:

[INFO ] Logger: Record log in /private/var/mobile/Containers/Data/Application/0272A895-930E-4A35-9A7C-0C7FAF35271D/Documents/kivy.log [DEBUG ] Config: Upgrading from 0 to 1 [WARNING] Config: Upgrading configuration in progress. [WARNING] Config: Older configuration version detected (0 instead of 27) [INFO ] Kivy: v2.2.1 [INFO ] Kivy: Installed at "/private/var/containers/Bundle/Application/C46E6088-CCB8-406E-B4D5-E407DBDD1FC8/MyApp.app/lib/python3.10/site-packages/kivy/init.py" [INFO ] Python: v3.10.10 (main, Aug 24 2023, 02:03:55) [Clang 14.0.3 (clang-1403.0.22.14.1)] [INFO ] Python: Interpreter at "/private/var/containers/Bundle/Application/C46E6088-CCB8-406E-B4D5-E407DBDD1FC8/MyApp.app/MyApp" [INFO ] Logger: Purge log fired. Processing... [INFO ] Logger: Purge finished! [WARNING] stderr: Traceback (most recent call last): [WARNING] stderr: File "", line 45, in load_module [WARNING] stderr: File "/Users/myname/Documents/Projects/MyApp-IOS/dist/root/python3/lib/python3.10/imp.py", line 343, in load_dynamic [WARNING] stderr: File "", line 719, in _load [WARNING] stderr: File "", line 674, in _load_unlocked [WARNING] stderr: File "", line 571, in module_from_spec [WARNING] stderr: File "", line 1176, in create_module [WARNING] stderr: File "", line 241, in _call_with_frames_removed [WARNING] stderr: ImportError: dynamic module does not define module export function (PyInit_kivy__event) [WARNING] stderr: [WARNING] stderr: During handling of the above exception, another exception occurred: [WARNING] stderr: [WARNING] stderr: Traceback (most recent call last): [WARNING] stderr: File "/Users/myname/Documents/Projects/MyApp-IOS/myapp-ios/YourApp/main.py", line 31, in [WARNING] stderr: File "/private/var/containers/Bundle/Application/C46E6088-CCB8-406E-B4D5-E407DBDD1FC8/MyApp.app/lib/python3.10/site-packages/kivy/uix/modalview.py", line 79, in [WARNING] stderr: from kivy.animation import Animation [WARNING] stderr: File "/private/var/containers/Bundle/Application/C46E6088-CCB8-406E-B4D5-E407DBDD1FC8/MyApp.app/lib/python3.10/site-packages/kivy/animation.py", line 88, in [WARNING] stderr: from kivy.event import EventDispatcher [WARNING] stderr: File "/private/var/containers/Bundle/Application/C46E6088-CCB8-406E-B4D5-E407DBDD1FC8/MyApp.app/lib/python3.10/site-packages/kivy/event.py", line 8, in [WARNING] stderr: import kivy._event [WARNING] stderr: File "", line 49, in load_module [WARNING] stderr: File "/Users/myname/Documents/Projects/MyApp-IOS/dist/root/python3/lib/python3.10/imp.py", line 343, in load_dynamic [WARNING] stderr: ImportError: dynamic module does not define module export function (PyInit__event)

The crash itself happens at:

"from kivymd.app import MDApp" (my first Kivy-related import line, but it crashes on any first Kivy import anyway, I tested it)

Please help, thank you!

CoderCoderCoder commented 10 months ago

I found the solution for this problem - prepared a separate conda environment with Python 3.10.10 installed (instead of 3.9.x in my case). Also I built everything besides of hostpython for arm64 only.