I have been trying for a while to build an application using Kivy SDL2 with python3crystax and everything works as expected.
I made the minimum api to be 16 and the target to be 21 (as this is the most crystax has at the moment)
The application works fine on any android below 5 but crashes on 5 or above. In logcat all i manage to see with the filter "-s AdBuddiz:D python:D"
is that it stops working when it gets here:
I/python (10645): Android kivy bootstrap done. __name__ is __main__
I/python (10645): AND: Ran string
I/python (10645): Run user program, change dir and execute entrypoint
I/python (10645): main.py
I/python (10645): [WARNING] [Config ] Older configuration version detected (0 instead of 19)
I/python (10645): [WARNING] [Config ] Upgrading configuration in progress.
I/python (10645): [INFO ] [Logger ] Record log in /data/data/f4f.ddddd.com.f4f/files/app/.kivy/logs/kivy_17-06-12_0.txt
I/python (10645): [INFO ] [Kivy ] v1.10.0
I/python (10645): [INFO ] [Python ] v3.5.0 (default, Dec 24 2015, 05:56:40)
I/python (10645): [GCC 5.3 20151204]
I/python (10645): [INFO ] [Factory ] 194 symbols loaded
I/python (10645): [INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
I/python (10645): [INFO ] [Text ] Provider: sdl2
This is all I see before it crashes without any error, and it only crashes on android 5+ and only when using the SDL2 version of kivy.
My question is, why exactly does it crash?
EDIT: After debugging further, i found the following error being displayed in logcat
E/WindowState( 1331): getStack: Window{33a025fb u0 f4d.ddddd.com.f4f/org.kivy.android.PythonActivity} couldn't find taskId=249 Callers=com.android.server.wm.WindowState.getDisplayContent:776 com.android.server.wm.WindowState.getWindowList:1347 com.android.server.wm.WindowState.getNeedsMenuLw:715 com.android.internal.policy.impl.PhoneWindowManager.updateSystemUiVisibilityLw:6862
EDIT 2: After more debugging and trying other example applications, it appears to be something within my code that is making it crash on higher version android OSs. Will start stripping down the code and see where it crashes
EDIT 3: Apparently what was crashing my application was my AdBuddiz implementation
from kivy.app import platform
if platform == 'android':
from utils import PythonActivity, AdBuddiz
class AdsNetwork:
def __init__(self):
if platform == "android":
AdBuddiz.setPublisherKey("TEST_PUBLISHER_KEY") # replace the key with your app Key
AdBuddiz.setTestModeActive() # test mode will be active
AdBuddiz.cacheAds(PythonActivity.mActivity) # now we are caching the ads
def show_ads(self):
if platform == 'android':
AdBuddiz.showAd(PythonActivity.mActivity) #show a popup ad
The problem is the following:
For android bellow 5 the activity is called org.renpy.android.PythonActivity
so when we initialize AdBuddiz like the documentation tells us to, it will work for android versions bellow 5 but for android 5 and above, the activity class name is org.kivy.android.PythonActivity
which will obviously fail if we try to autoclass using the old activity class name