App which runs on Mac crashing on android after compiling successfully

85 views
Skip to first unread message

Abhishek cherath

unread,
Jul 4, 2019, 4:09:07 PM7/4/19
to Kivy users support
Hello,

from kivy.app import App
from kivmob import KivMob, TestIds

from kivy.uix.scatter import Scatter
from kivy.uix.label import Label
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.textinput import TextInput
from kivy.uix.boxlayout import BoxLayout
from kivy.core.text import FontContextManager as FCM
import random
class ScatterTextWidget(BoxLayout):
APPID = 'ca-app-pub-NUMBER'
BANNERID = 'ca-app-pub-NUMBER'
ads = KivMob(APPID)
ads.new_banner(BANNERID)
ads.request_banner()
ads.show_banner()
pass

class DiceRollerApp(App):
def build(self):
return ScatterTextWidget()
if __name__ == "__main__":
DiceRollerApp().run()

This is the basic structure of my app, there is a .kv file with the UI and basic functionality. This is not working however (crashes on startup) I've made the Buildozer.spec according to the https://github.com/MichaelStott/KivMob Quickstart.

I've posted the relevant logical bit in the next post.

Thanks for your help!!

Abhishek cherath

unread,
Jul 4, 2019, 4:13:35 PM7/4/19
to Kivy users support
logcat_diceroller

Abhishek cherath

unread,
Jul 4, 2019, 4:18:14 PM7/4/19
to Kivy users support
The errors I can find are these:

07-05 01:29:47.281  6467  6467 W ResourceType: Failure getting entry for 0x7f130537 (t=18 e=1335) (error -2147483647)


07-05 01:29:48.115  6180  6180 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/base.apk"],nativeLibraryDirectories=[/data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/lib/arm, /data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]] couldn't find "libpython2.7.so"
07-05 01:29:48.116  6180  6180 V pythonutil: Loading library: python3.5m
07-05 01:29:48.118  6180  6180 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/base.apk"],nativeLibraryDirectories=[/data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/lib/arm, /data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]] couldn't find "libpython3.5m.so"
07-05 01:29:48.118  6180  6180 V pythonutil: Loading library: python3.6m
07-05 01:29:48.120  6180  6180 V pythonutil: Library loading error: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/base.apk"],nativeLibraryDirectories=[/data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/lib/arm, /data/app/org.test.diceroller-HzeCWnhBRt5F4zev5q6DMg==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib, /product/lib]]] couldn't find "libpython3.6m.so"
07-05 01:29:48.120  6180  6180 V pythonutil: Loading library: python3.7m
07-05 01:29:48.121   413   413 W /system/bin/hwservicemanager: Cannot open /odm/manifest.xml
07-05 01:29:48.124   983  1329 I chatty  : uid=1000(system) HwWifiStatStore expire 2 lines
07-05 01:29:48.128   412   412 E ServiceManager: try to find service failed, not allowed access from isolated processes.
07-05 01:29:48.129  6467  6467 W board.boxer.app: type=1400 audit(0.0:44991): avc: denied { read } for name="vmstat" dev="proc" ino=4026532164 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0
07-05 01:29:48.137  4604  4604 I hwaps   : JNI_OnLoad
07-05 01:29:48.145  6180  6180 V pythonutil: Loading library: main
07-05 01:29:48.146  6555  6555 D HwFLClassLoader: USE_FEATURE_LIST had not init! 
07-05 01:29:48.154  6180  6180 V pythonutil: Failed to load _io.so or unicodedata.so...but that's okay.
07-05 01:29:48.155  6180  6180 V pythonutil: Unsatisfied linker when loading ctypes
07-05 01:29:48.156  6180  6180 V pythonutil: Loaded everything!

07-05 01:29:51.372   413   413 W /system/bin/hwservicemanager: Cannot open /odm/manifest.xml
07-05 01:29:51.401   413   413 W /system/bin/hwservicemanager: Cannot open /odm/manifest.xml
07-05 01:29:51.407   486  6710 W SocketClient: write error (Broken pipe)

07-05 01:29:51.905  6180  6615 I python  : [INFO   ] [KivMob      ] show_banner() called.
07-05 01:29:51.939  6729  6729 I HwCust  : Constructor found for class com.android.settings.HwCustSettingUtilsImpl
07-05 01:29:51.939  6729  6729 D HwCust  : Create obj success use class com.android.settings.HwCustSettingUtilsImpl
07-05 01:29:51.941  6180  6180 D HwFLClassLoader: USE_FEATURE_LIST had not init! 
07-05 01:29:52.001  6180  6615 I python  : [INFO   ] [Window      ] Provider: sdl2
07-05 01:29:52.039  6180  6615 E libEGL  : validate_display:107 error 3008 (EGL_BAD_DISPLAY)
07-05 01:29:52.039  6180  6615 I iGraphics: [0030080c] opt app: 0
07-05 01:29:52.040  6180  6615 V SDL     : setOrientation() orientation=-1 width=800 height=600 resizable=true hint=
07-05 01:29:52.042  6729  6729 D UsbSettingsService: register intent receiver
07-05 01:29:52.046  6729  6729 D UsbSettingsService: BroadcastReceiver, action = android.hardware.usb.action.USB_STATE
07-05 01:29:52.047  6180  6615 D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
07-05 01:29:52.047  6729  6729 D UsbSettingsService: ACTION_USB_STATE, usbConnected = true
07-05 01:29:52.049  6729  6729 D UsbSettingsService: ACTION_USB_STATE usbConnected = true, chargingOnly = false, deviceConnected = true, dataRole = -1

07-05 01:29:52.372  6180  6615 I python  :    File "/home/abhishek/DiceRoller/.buildozer/android/platform/build/build/python-installs/DiceRoller/kivy/core/text/__init__.py", line 356, in resolve_font_name
07-05 01:29:52.373  6180  6615 I python  :  OSError: Label: File 'roboto-thinitalic.ttf' not found
07-05 01:29:52.373  6180  6615 I python  : Python for android ended.
07-05 01:29:52.389  6180  6206 I zygote  : Do partial code cache collection, code=62KB, data=47KB
07-05 01:29:52.393  6180  6206 I zygote  : After code cache collection, code=62KB, data=47KB
07-05 01:29:52.394  6180  6206 I zygote  : Increasing code cache capacity to 256KB
07-05 01:29:52.398  2028 30344 D WorkSource: i1=0 i2=0 N1=0: insert 10018 com.google.android.gms


Is the problem that the font isn't there? How do I install it?

Thanks,
Abhishek

On Friday, 5 July 2019 01:39:07 UTC+5:30, Abhishek cherath wrote:

Kuam

unread,
Jul 4, 2019, 6:01:47 PM7/4/19
to Kivy users support
Looks like the font could be the issue. I thought roboto was built in, but maybe roboto-thinitalic is not?  Kivy will use system fonts so maybe the font is on your Mac, but not on Android so you should probably try loading it manually.  To do so, first you'll need to download the .ttf file of the font you want and put it in your projects directory.  Then in your code, add the import:
 from kivy.core.text import LabelBase

and then in your def build(self) function:

LabelBase.register(name='whatever_you_want_to_name_it', fn_regular='path/to/your/font/thefontyouwant.ttf')

then whenever you're specifying a font_name, just put what you have in the name parameter like so:

font_name:'whatever_you_want_to_name_it'

Oh, and don't forget to change your buildozer.spec to include .ttf files in the "Source files to include" bit.
Reply all
Reply to author
Forward
0 new messages