-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXC_BAD_ACCESS error thrown when running application #908
Comments
I'm facing exactly the same problem. Did you get to solve it? |
Unfortunately, no. I gave up. I was trying to solve it for two weeks or so and tried everything I could think of short of rewriting Kivy iOS code. We decided to rewrite the app in Capacitor.js, which I find to be far less buggy and prefer it over Kivy. The app is in alpha stages so it's not that much of a hassle. My best guess is that this is some sort of weird edge case either in Kivy iOS/Kivy itself or one of the associated tools/libraries or one particular version of it. What exactly is the culprit, I have no idea. I did try using two older versions of Kivy iOS, but those two threw a bunch of other errors at compile time and I wasn't willing to deal with them after already battling with Kivy for weeks. Please let me know if you manage to solve it and if you know of a way I can perhaps assist you in solving this. |
Can you please post the full log before the failure happens, and add a minimum reproducible example? |
Okay I have the same problem with recent macOS 14.5 ARM and XCode 15.4 targeting iOS 17.4 on a Simulator. It seems to be simulator only problem (???) as I did build and work on a real iPhone SE with iOS 15.7.9. Not sure how it behaves on physical device with iOS 17.4 as I do not have any. @OptimusePrime have you tried running your code on a physical device? Can you try on physical device with iOS 17.4? Use USB cable, Trust mac and iPhone, then you will be able to build and run from XCode selecting your phone from a target drop down list. As easy as running on simulator but we would then have a comparison point. I have made an example project with kivy-ios toolchain using kivy.git/examples/animation as reference. But this happens also with my own project. Will try to get familiar with XCode debug features in order to traceback / pinpoint the cause. Console output below.
Simulator throws this on crash:
|
I've run into issues in the past with matplotlib initialization and a bad access. It was only on the simulator. To build only the device or the simulator, please see the method described in Issue #865 I found rebuilding for simulator multiple times will sometimes fix the issue, and I can then generate the images needed for the Apple store. My suspicion is that it may be bitcode related, as that is one of the flags the was being used for simulator, but not the device. |
Python : 3.12.6 Hello everyone, I have exactly the same problem. The simulator crashes, but my app runs on the iPhone. @tcaduser Which command do you use to build the simulator? Best regards |
I @Dekto, it's been almost a year since I've looked at this issue. If I remember correctly I just keep doing:
over and over until it doesn't crash. But this is only if the issue is with If I remember correctly, you also have to do a:
where You may want to look at your stack trace to see where your application is crashing. My method was to keep commenting out python statements in my application until it stopped crashing. |
Hello again, I was able to solve the problem by installing the older iOS Simulator Runtime 17.2. Best regards |
Versions
Describe the bug
A Kivy application successfully compiles using both standard Kivy iOS Toolchain and Buildozer (although it uses Toolchain under the hood). Once compiled, it is ran on an iOS 17.4 simulator. The Kivy logo is displayed and I see in the debug log that the application starts running. However, once most loading is finished and at the point when the application should fully load and display its UI, Xcode pauses the application and throws EXC_BAD_ACCESS error, a segmentation violation, along with the offending thread (which is nondeterministic) and the memory address to which access was attempted. If Xcode is forced to resume the app, it crashes.
To Reproduce
To compile the app, I followed standard Kivy iOS docs, so I ran the following commands.
python toolchain.py build kivy python3 pillow plyer
python toolchain.py pip install oscpy kivymd==1.2.0
python toolchain create <PROJECT_NAME> <PROJECT_PATH>
Afterwards I simply ran the app in Xcode on an iOS 17.4 simulator.
All of this was done using the latest, cloned version of kivy-ios and a virtual environment.
I have successfully reproduced the issue on two different MacBooks, the first had M2 chip and the second M1. I also did so using both a fairly complex app and a hello world app which simply displayed a text (in that case, I didn't build
plyer
andpillow
nor installedoscpy
andkivymd
), so it seems any app will throw this error, even a simple one.Both threw the same error.
In the case of the hello world app, once I cleaned the build folder, the app did actually show the text, but the error was thrown immediately afterwards nevertheless.
Expected behavior
I expected the app to run without errors.
Logs
There are no useful logs in this case as the application runs successfully. LLDB doesn't itself throw any error logs that are relevant, only Xcode shows this error with little useful information other than the memory address.
Screenshots
The text was updated successfully, but these errors were encountered: