Hi!
I tested my app on an iPhone 8 simulator in Xcode without problems, but when I tried to run it on a physical iPhone 5s I get an error saying that I can't write a file. Why? Where do I change that?:
PermissionError: [Errno 1] Operation not permitted: 'geo-esp-train.cfg'
2021-02-28 23:09:59.085006+0100 geo-esp-training[457:91293] Application quit abnormally!
2021-02-28 23:09:59.294003+0100 geo-esp-training[457:91293] Leaving
I tested my app on an iPhone 8 simulator in Xcode without problems, but when I tried to run it on a physical iPhone 5s I get an error saying that I can't write a file. Why? Where do I change that?:
PermissionError: [Errno 1] Operation not permitted: 'geo-esp-train.cfg'
2021-02-28 23:09:59.085006+0100 geo-esp-training[457:91293] Application quit abnormally!
2021-02-28 23:09:59.294003+0100 geo-esp-training[457:91293] Leaving
Solved!
It turns out that the fact that Xcode and iOS and dlopen could not find a 'Foundation.framework' 'image' was not the real problem.
Python gave this error log:
Traceback (most recent call last):
File "/Users/henrik/geo-esp-training-ios/YourApp/main.py", line 252, in <module>
File "/Users/henrik/geo-esp-training-ios/YourApp/main.py", line 180, in __init__
PermissionError: [Errno 1] Operation not permitted: 'geo-esp-train.cfg'
2021-03-10 14:18:50.105679+0100 geo-esp-training[448:20514] Application quit abnormally!
2021-03-10 14:18:50.161136+0100 geo-esp-training[448:20514] Leaving
The solution was to actively specify in Python-Kivy that my data files have to be written to the app user data directory. This is how to do that:
It turns out that the fact that Xcode and iOS and dlopen could not find a 'Foundation.framework' 'image' was not the real problem.
Python gave this error log:
Traceback (most recent call last):
File "/Users/henrik/geo-esp-training-ios/YourApp/main.py", line 252, in <module>
File "/Users/henrik/geo-esp-training-ios/YourApp/main.py", line 180, in __init__
PermissionError: [Errno 1] Operation not permitted: 'geo-esp-train.cfg'
2021-03-10 14:18:50.105679+0100 geo-esp-training[448:20514] Application quit abnormally!
2021-03-10 14:18:50.161136+0100 geo-esp-training[448:20514] Leaving
The solution was to actively specify in Python-Kivy that my data files have to be written to the app user data directory. This is how to do that:
Code Block class RootLayout(FloatLayout): # This is the root widget of my Kivy app def __init__(self, kwargs): super().__init__(kwargs) app = App.get_running_app() print("app.directory = ", app.directory) print("app.user_data_dir = ", app.user_data_dir) global configfilename, user_data_dir_path configfilename = os.path.join(app.user_data_dir, 'geo-esp-train.cfg') user_data_dir_path = app.user_data_dir # Used for other data files.