You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Base: Failed to import "android" module. Could not remove android presplash. #1153
This occurs after removing the .buildozer folder, and using the latest master checkouts of buildozer and python-for-android. This occurs when trying to use the 'android_old' target (the 'android' gives us this error: #1142)
This is just a notification, it shouldn't actually cause anything to fail.
The actual reason for the warning is that Kivy actually does from android import remove_presplash, which is not present when the android module is compiled with pygame. I guess the notification should be made clearer, on general principle.
The reason for concern is that our android service is now not starting. I thought this might be the reason, but let me eliminate the possible of the service breaking for other reasons...
Is there a way to add --service=myservice:/path/to/myservice.py argument to p4a via the buildozer.spec, or do we need to user the Service folder method?
# Application pushed.
# Run on 0123456789ABCDEF
# Run '/home/kivy/.buildozer/android/platform/android-sdk-23/platform-tools/adb shell am start -n speedtest.maths.xxx.com/org.renpy.android.PythonActivity -a org.renpy.android.PythonActivity'
# Cwd /home/kivy/.buildozer/android/platform
Starting: Intent { act=org.renpy.android.PythonActivity cmp=speedtest.maths.xxx.com/org.renpy.android.PythonActivity }
Error type 3
Error: Activity class {speedtest.maths.xxx.com/org.renpy.android.PythonActivity} does not exist.
# Application started.
I see somewhere that that has been renamed to PythonService? This is building with the android_old.
I think the services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY line is for new-style python-for-android services, although these will only work with the sdl2 bootstrap.
I don't know what's up with your intent error. Is this just what happens when you run buildozer android_old debug run? It looks like buildozer might just have some wrong assumption about the activity name, although it does look right to me.
We are using SDL, but I can't seem to get the service working. As well as the conventional:
from android import AndroidService
upd_process = AndroidService('CAMI-Apps service', 'running')
upd_process.start('CAMI-Apps service started')
we also tried service creation as below. It does not throw an error in the app but still does not run:
service = autoclass('org.renpy.android.PythonActivity')
service.start_service(
'CAMI-Apps Content Service',
'Installs CAMI-Apps Educational Content',
'argument to service')
Also, adding the below to the buildozer.spec file,
services = myservice:service/main.py
we still get the 'class not found error'
service = autoclass('xxx/ServiceMyservice' + )
throws
Could not create service: Class not found 'xxx/ServiceMyservice',
How to get this working? This is getting quite critical for us as it's been over 2 weeks since we could put out a working build. Using the new toolchain is not an option as we get the libpythonxxx SDLError both our testing tablets. How to go forward?
it's been over 2 weeks since we could put out a working build
Did you have a working build before that and something broke? Or that is just when you started trying to use this functionality?
we also tried service creation as below. It does not throw an error in the app but still does not run:
Is there definitely nothing in the log here? Would you be able to post it? Given how the android module is structured, I would have expected at least some kind of notification about what's going on.
Also, adding the below to the buildozer.spec file,
...
we still get the 'class not found error'
This method will definitely only work with the sdl2 bootstrap, so that's at least an okay error.
@staticmethod
def try_orig():
"""
This holds the code used to create the original python service using the
old toolchain.
"""
try:
from android import AndroidService
upd = AndroidService("CAMI-Apps Service", "running")
upd.start("CAMI-Apps service started.")
return True
except Exception as e:
Logger.error(
"androidservice.py: try_orig failed with {0}".format(e))
return False
Now produces the following log and the error trap above is never reached:
Failed to import "android" module. Could not remove android presplash.
This message to me looks like a regression even though it doesn't crash. I remember adding android module to buildozer.spec requirements fixed it before (AndreMiras/PyWallet@68952ef), but now not anymore (AndreMiras/EtherollApp@5a8c41c).
The main difference between the two apps, is the first one is still on Python2 and was build with older dependencies (like p4a) and the other one is on Python3 CrystaX and run with everything more recent.
This is also a bit annoying because it spams my Sentry logs, I may investigate further.
Activity
inclement commentedon Oct 27, 2017
This is just a notification, it shouldn't actually cause anything to fail.
The actual reason for the warning is that Kivy actually does
from android import remove_presplash, which is not present when the android module is compiled with pygame. I guess the notification should be made clearer, on general principle.Zen-CODE commentedon Oct 27, 2017
The reason for concern is that our android service is now not starting. I thought this might be the reason, but let me eliminate the possible of the service breaking for other reasons...
Zen-CODE commentedon Oct 28, 2017
@inclement
From https://python-for-android.readthedocs.io/en/latest/services/
Is there a way to add --service=myservice:/path/to/myservice.py argument to p4a via the buildozer.spec, or do we need to user the Service folder method?
Zen-CODE commentedon Oct 28, 2017
@the buildozer log is showing the following:
I see somewhere that that has been renamed to PythonService? This is building with the android_old.
inclement commentedon Oct 28, 2017
I think the
services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PYline is for new-style python-for-android services, although these will only work with the sdl2 bootstrap.I don't know what's up with your intent error. Is this just what happens when you run
buildozer android_old debug run? It looks like buildozer might just have some wrong assumption about the activity name, although it does look right to me.Zen-CODE commentedon Oct 28, 2017
Yes, that's the command which produces this. I'll do some more digging and come back....
Zen-CODE commentedon Oct 30, 2017
We are using SDL, but I can't seem to get the service working. As well as the conventional:
we also tried service creation as below. It does not throw an error in the app but still does not run:
Also, adding the below to the buildozer.spec file,
we still get the 'class not found error'
throws
How to get this working? This is getting quite critical for us as it's been over 2 weeks since we could put out a working build. Using the new toolchain is not an option as we get the libpythonxxx SDLError both our testing tablets. How to go forward?
inclement commentedon Oct 31, 2017
Did you have a working build before that and something broke? Or that is just when you started trying to use this functionality?
Is there definitely nothing in the log here? Would you be able to post it? Given how the android module is structured, I would have expected at least some kind of notification about what's going on.
This method will definitely only work with the sdl2 bootstrap, so that's at least an okay error.
Zen-CODE commentedon Oct 31, 2017
Trying
Now produces the following log and the error trap above is never reached:
Search for 'androidservice.py' to find the point where it tries to call the above code.
Now the error is different. Is "No JNI_OnLoad found" indicative of something?
Zen-CODE commentedon Oct 31, 2017
I am happy to report we found the issue. The service dies the moment it calls this code, but it works in the app
Not sure why as there is not message I could detect, but moving this outside the service makes it work again. Yay
@inclement. Thanks
AndreMiras commentedon May 25, 2018
This message to me looks like a regression even though it doesn't crash. I remember adding
androidmodule tobuildozer.specrequirements fixed it before (AndreMiras/PyWallet@68952ef), but now not anymore (AndreMiras/EtherollApp@5a8c41c).The main difference between the two apps, is the first one is still on Python2 and was build with older dependencies (like p4a) and the other one is on Python3 CrystaX and run with everything more recent.
This is also a bit annoying because it spams my Sentry logs, I may investigate further.