I have now run my Kivy app on an iPhone 5s simulator in Xcode. That gives a slightly different error, but the app DOES run without any real problems. So the question is: How serious are these 'dlopen' errors? Here comes the slightly different error from the simulator:
Got dlopen error on Foundation: dlopen(/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 1): no suitable image found. Did find:
/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation: mach-o, but not built for iOS simulator
Got fallback dlopen error on Foundation: dlopen(/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 1): image not found
Note that I DON'T get this error:
2021-02-28 23:09:59.023510+0100 geo-esp-training[457:91731] XPC connection interrupted
Note:
My Mac has 29 'Foundation.framework' folders and a total of 672
'*Foundation.framework' folders... So how am I to know which folder to
point to instead of the one where the 'image' is not found?
Post
Replies
Boosts
Views
Activity
It's Python. The error occurs in this file write operation statement (line 180): json.dump(self.config_data, config_file)
Here is the Traceback:
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-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
That's a global string variable:
configfilename = 'geo-esp-train.cfg'
It's simply a filename. No path. In Android the OS automatically allocates a default folder for the app, where the file is automatically created. So I presumed that iOS works in a similar way?
OK. Interesting! Does that mean that this error is the result of the error I reported in another question, that has not yet been answered?:
https://developer.apple.com/forums/thread/675071 - Got dlopen error on Foundation: (...): image not found
PS: It's late night here in Europe, so I will go to bed now. :-)
I still haven't found a solution nor received any answered on the forums where I have posted my 'dlopen' problem. Someone asked me to try a newer iPhone, so I have bought an iPhone 7.
My Python-Kivy app runs without any real problems on the iPhone 7 simulator (in Xcode). But the physical iPhone 7 gives the same error as the iPhone 5s. Here is the relevant part of the log output from Xcode:
Got dlopen error on Foundation:
dlopen(/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 1): image not found
Got fallback dlopen error on Foundation:
dlopen(/Groups/System/Library/Frameworks/Foundation.framework/Versions/Current/Foundation, 1): image not found
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
Please help! It's very important that I get this app to run on iOS!
Sorry for not getting back earlier!
Someone suggested that I tried a newer iPhone, so I bought an iPhone 7. But that didn't help. I get exactly the same problem.
You say: "Visit the supporting site of that framework".
Would that be the github page for Python-Kivy-iOS - https://github.com/kivy/kivy-ios/ ?
I already tried posting an issue there, without any answers.... :-(
Please help. It's important that I get this app to run on iOS!
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:
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.
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:
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.
OK. I will try that. Thanks.
Yes! On a Kivy discussion forum on discord.com (Apple will not allow me to write the direct link here) someone showed me how to delete 2 Build Settings in Xcode containing 'simulator'. That solved it.
I solved the problem the primitive way, by looking at the pixel-format of all the default launch image PNG-files in the LaunchImages folder under the Xcode project my app-ios folder and overwriting them one by one with my (PNG) launch images of the same pixels size... It works for now.
Good question. :-)
I guess I didn't really think about whether a "launchscreen storyboard" is a set of image files or what it is? :-)
After a long correspondance with Apple Developer Program Support they finally told me that the yellow "!" warning was just a general reminder that you need to fill out the whole page... Well... I find it quite misleading.
And there are other strange peculiarities with the system: When I click on the specific build, the left column menu disappears, and I can't get it back. Not even by logging out and in again. But then I discovered that apparently the left column menu suddenly becomes an expand-/pulldown-menu just below the top menu line... This is a strange system - if you ask ME.