question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

app crash on close

See original GitHub issue

When I exit my app (app.stop()), a strange segmentation error occurs: http://pastebin.com/F8HEaeip

This is with sdl2 and kivy 1.9.2 dev. It works fine with pygame, what makes me puzzled.

The requirements list: requirements = openssl,geopy,plyer,android,tinydb,hostpython2,kivy==master

What could be the reason of this crash?

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
cidermolecommented, Aug 12, 2016

Here’s the problem I experienced (with crash in the same place):

Nobody destroys the app Window by default. Then long after Python is gone (“Python for android ended.”), Java will call back via Activity.onPause() into SDL native code, which then references a stale Android_Window in Java_org_libsdl_app_SDLActivity_nativePause().

Workaround:

You must call WindowSDL.close() before the app exits the main EventLoop.

An ideal way to do this is to handle the event in App.on_stop():

from kivy.app import App
from kivy.core.window import Window

class MyFancyApplication(App):
    def on_stop(self):
        Window.close()

# ...

# somewhere else:
App.get_running_app().stop()
0reactions
inclementcommented, Jan 30, 2019

I believe this is no longer happening on p4a master. Recently I was testing this type of thing while getting pause to work with sdl2.0.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do my apps keep crashing on Android, How to fix it
How to fix apps that keep crashing on Android · 1. Force stop the app · 2. Restart the device · 4. Reinstall...
Read more >
How to Fix Crashing Apps on an iPhone or Android?
10 Solutions to fix App Crashes and Keep Apps Running: For Apple iPhone, Samsung Galaxy, LG, Lenovo and Sony Xperia smartphones. If you've...
Read more >
Why are the apps on my phone crashing and force closing?
In some instances, an app may force close, crash, frequently freeze or stop responding, or generally not work as the app was designed....
Read more >
How to Stop Apps From Crashing on Android - AVG
When apps keep closing, sometimes uninstalling and reinstalling the app can fix the problem. Your app might be out of date or have...
Read more >
Why are my Android phone apps crashing or closing & how to ...
A 'Google forced closed' error is appearing · Open the Settings app · Tap Apps · Tap Google · Tap Storage · Tap...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found