App crashes after startup screen

394 views
Skip to first unread message

André Carvalho

unread,
Jan 8, 2021, 10:33:36 AM1/8/21
to Kivy users support
Hello everyone!

I've googled a lot about this errors and even searched it here, with no solution whatsoever. My app created with Kivy crashes on phone after startup screen. App works fine on my computer. I've created a backend API for this app and deployed it on Heroku. I'ld appreciate any help anyone here can provide me.

main.py
####################
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.storage.jsonstore import JsonStore
from hoverable import HoverBehavior
from kivy.uix.image import Image
from kivy.uix.behaviors import ButtonBehavior
from urllib3.exceptions import HTTPError, MaxRetryError
import urllib3
import json

user_key = 0

store = JsonStore('token.json')
http = urllib3.PoolManager()

Builder.load_file('design.kv')


class LoginScreen(Screen):

    def sign_up(self):
        self.manager.transition.direction = 'left'
        self.manager.current = 'sign_up_screen'

    def login(self, username, password):
        try:
            r = http.request('POST', base_url, fields={
                'username': username,
                'password': password,
            })
            data = json.loads(r.data.decode('utf-8'))
            if 'key' in data.keys():
                store.put('user', token=data['key'])
                # To get the user token
                # print(store.get(username)['token'])
                self.manager.transition.direction = 'left'
                self.manager.current = 'login_screen_success'
            else:
                for key in data:
                    self.ids.error.text = '{}'.format(data[key][0])
        except MaxRetryError:
            self.ids.error.text = 'Unable to connect to server. Please retry later.'


class LoginScreenSuccess(Screen):

    def logout(self):
        r = http.request('POST', '{}logout/'.format(base_url), fields={})
        data = json.loads(r.data.decode('utf-8'))
        if 'detail' in data.keys():
            self.manager.transition.direction = 'right'
            self.manager.current = 'login_screen'

    def enlight(self, feeling):
        try:
            r = http.request('GET', '{}quotes?cat={}'.format(base_url, feeling),
                             headers={"Authorization": "Token {}".format(store.get('user')['token'])})
            data = json.loads(r.data.decode('utf-8'))
            self.ids.quote.text = data[0]['text']
        except HTTPError as e:
            print(json.loads(e.read().decode('utf-8')))


class SignUpScreen(Screen):
    def add_user(self, username, email, password1, password2):
        try:
            r = http.request('POST', '{}registration/'.format(base_url), fields={
                'username': username,
                'email': email,
                'password1': password1,
                'password2': password2,
            })
            data = json.loads(r.data.decode('utf-8'))
            if 'key' in data.keys():
                self.manager.current = 'sign_up_screen_success'
            else:
                print(data)
        except HTTPError as e:
            print(e)


class SignUpScreenSuccess(Screen):
    def go_to_login(self):
        self.manager.transition.direction = 'right'
        self.manager.current = 'login_screen'


class ImageButton(ButtonBehavior, HoverBehavior, Image):
    pass


class RootWidget(ScreenManager):
    pass


class MainApp(App):
    def build(self):
        return RootWidget()


if __name__ == '__main__':
    MainApp().run()
####################

design.kv
####################
<LoginScreen>:
    GridLayout:
        cols: 1
        GridLayout:
            cols: 1
            padding: 15, 15
            spacing: 20, 20
            Label:
                text: "User Login"
                font_size: '20sp'
            TextInput:
                id: username
                hint_text: "Username"
            TextInput:
                id: password
                hint_text: "Password"
                password: True
            RelativeLayout:
                Button:
                    text: "Login"
                    on_press: root.login(root.ids.username.text, root.ids.password.text)
                    size_hint: 0.3, 0.5
                    pos_hint: {'center_x': 0.5, 'center_y': 0.5}
            Label:
                id: error
                text: ""
        GridLayout:
            cols: 2
            size_hint: 0.2, 0.2
            padding: 10, 10
            spacing: 10, 0
            Button:
                text: "Forgot password?"
                background_color: 1, 1, 1, 0
                opacity: 1 if self.state == 'normal' else 0.5
                color: 0.1, 0.7, 1, 1
            Button:
                text: "Sign Up"
                background_color: 1, 1, 1, 0
                opacity: 1 if self.state == 'normal' else 0.5
                color: 0.1, 0.7, 1, 1
                on_press: root.sign_up()

<LoginScreenSuccess>:
    GridLayout:
        cols: 1
        padding: 30, 30
        spacing: 30, 30
        RelativeLayout:
            ImageButton:
                on_press: root.logout()
                source: 'logout_hover.png' if self.hovered else "logout_nothover.png"
                size_hint: 0.35, 0.35
                pos_hint: {'center_x': 0.93, 'center_y': 0.8}
        Label:
            text: 'How do you feel?'
        TextInput:
            id: feeling
            hint_text: 'Things to try: happy, sad, unloved...'
        Button:
            text: 'Enlighten me'
            on_press: root.enlight(root.ids.feeling.text)
        ScrollView:
            Label:
                id: quote
                text: ''
                text_size: self.width, None
                size_hint_y: None
                height: self.texture_size[1]

<SignUpScreen>:
    GridLayout:
        cols: 1
        padding: 10, 10
        spacing: 0, 10
        Label:
            text: "Sign up for a space journey!"
            font_size: '18sp'
        TextInput:
            size_hint: 0, 0.5
            id: username
            hint_text: "Username"
        TextInput:
            size_hint: 0, 0.5
            id: email
            hint_text: "Email"
        TextInput:
            size_hint: 0, 0.5
            id: password1
            hint_text: "Password"
        TextInput:
            size_hint: 0, 0.5
            id: password2
            hint_text: "Repeat password"
        Label:
            id: error
            text: ""
        Button:
            text: "Submit"
            on_press: root.add_user(root.ids.username.text, root.ids.email.text, root.ids.password1.text, root.ids.password2.text)

<SignUpScreenSuccess>:
    GridLayout:
        cols: 1
        Label:
            text: "Sign up successful"
        Button:
            text: "Login page"
            on_press: root.go_to_login()

<RootWidget>:
    LoginScreen:
        name: "login_screen"
    LoginScreenSuccess:
        name: "login_screen_success"
    SignUpScreen:
        name: "sign_up_screen"
    SignUpScreenSuccess:
        name: "sign_up_screen_success"

####################

hoverable.py
####################
"""Hoverable Behaviour (changing when the mouse is on the widget by O. Poyen.
License: LGPL
"""
__author__ = 'Olivier POYEN'


from kivy.properties import BooleanProperty, ObjectProperty
from kivy.core.window import Window

class HoverBehavior(object):
    """Hover behavior.

    :Events:
        `on_enter`
            Fired when mouse enter the bbox of the widget.
        `on_leave`
            Fired when the mouse exit the widget 
    """

    hovered = BooleanProperty(False)
    border_point= ObjectProperty(None)
    '''Contains the last relevant point received by the Hoverable. This can
    be used in `on_enter` or `on_leave` in order to know where was dispatched the event.
    '''

    def __init__(self, **kwargs):
        self.register_event_type('on_enter')
        self.register_event_type('on_leave')
        Window.bind(mouse_pos=self.on_mouse_pos)
        super(HoverBehavior, self).__init__(**kwargs)

    def on_mouse_pos(self, *args):
        if not self.get_root_window():
            return # do proceed if I'm not displayed <=> If have no parent
        pos = args[1]
        #Next line to_widget allow to compensate for relative layout
        inside = self.collide_point(*self.to_widget(*pos))
        if self.hovered == inside:
            #We have already done what was needed
            return
        self.border_point = pos
        self.hovered = inside
        if inside:
            self.dispatch('on_enter')
        else:
            self.dispatch('on_leave')

    def on_enter(self):
        pass

    def on_leave(self):
        pass

from kivy.factory import Factory
Factory.register('HoverBehavior', HoverBehavior)

if __name__=='__main__':
    from kivy.uix.floatlayout import FloatLayout
    from kivy.lang import Builder
    from kivy.uix.label import Label
    from kivy.base import runTouchApp
    class HoverLabel(Label, HoverBehavior):
        def on_enter(self, *args):
            print("You are in, through this point", self.border_point)

        def on_leave(self, *args):
            print("You left through this point", self.border_point)

    Builder.load_string('''
<HoverLabel>:
    text: "inside" if self.hovered else "outside"
    pos: 200,200
    size_hint: None, None
    size: 100, 30
    canvas.before:
        Color:
            rgb: 1,0,0
        Rectangle:
            size: self.size
            pos: self.pos
    ''')
    fl = FloatLayout()
    fl.add_widget(HoverLabel())
    runTouchApp(fl)

####################

logcat errors
####################

############01-08 12:21:38.733 14821 15129 E avast! Shepherd: java.lang.RuntimeException: Registration failed: cannot get key from the server (https://au.ff.avast.sec.miui.com => )
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.ew.a(Unknown Source:195)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.ew.a(Unknown Source:4)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.ff.a(Unknown Source:27)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.el.b(Unknown Source:181)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.el.run(Unknown Source:44)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: Caused by: com.avast.android.sdk.engine.obfuscated.z: Cannot get key from registration server
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.t.a(Unknown Source:253)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.t.a(Unknown Source:3)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.t.a(Unknown Source:21)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.t.a(Unknown Source:4)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.t.a(Unknown Source:1)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.ew.a(Unknown Source:151)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: at com.avast.android.sdk.engine.obfuscated.ew.a(Unknown Source:0)
01-08 12:21:38.733 14821 15129 E avast! Shepherd: ... 4 more
01-08 12:21:38.970  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:38.971  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:39.971  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:39.971  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:40.178 14841 15326 E Analytics-Core-AndroidUtils: getUidByPackage exception: com.xiaomi.miglobaladsdk
01-08 12:21:40.229 17517 17544 E AppOpsAdapter:  doApplyAppPermissionConfig error 
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: android.content.pm.PackageManager$NameNotFoundException: org.test.myapp
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at android.app.ApplicationPackageManager.getPackageInfoAsUser(ApplicationPackageManager.java:184)
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at android.app.ApplicationPackageManager.getPackageInfo(ApplicationPackageManager.java:153)
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at com.lbe.security.service.provider.internal.AppOpsAdapter$AppOpsAdapterHandler.doApplyAppPermissionConfig(Unknown Source:30)
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at com.lbe.security.service.provider.internal.AppOpsAdapter$AppOpsAdapterHandler.handleMessage(Unknown Source:112)
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at android.os.Handler.dispatchMessage(Handler.java:106)
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at android.os.Looper.loop(Looper.java:201)
01-08 12:21:40.229 17517 17544 E AppOpsAdapter: at android.os.HandlerThread.run(HandlerThread.java:65)
01-08 12:21:40.972  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:40.973  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:41.772   640   708 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
01-08 12:21:41.775  1548  3982 E ANDR-PERF-JNI: com_qualcomm_qtiperformance_native_perf_io_prefetch_start
01-08 12:21:41.776   639   639 E ANDR-IOP: IOP HAL: Received pkg_name = org.howdoyoufeel.howdoyoufeel pid = -1
01-08 12:21:41.785   639   704 E ANDR-IOP: io prefetch is disabled
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: getClientExtra exception: 
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: java.lang.IllegalArgumentException: Context must contain application context.
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.policy.h.<init>(SourceFile:7)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.policy.h.a(SourceFile:5)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.AnalyticsCore.getClientExtra(SourceFile:2)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.util.g.b(SourceFile:2)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.util.g.a(SourceFile:4)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.LogEvent.a(SourceFile:40)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.LogEvent.<init>(SourceFile:42)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.collection.a.b(SourceFile:15)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at com.miui.analytics.internal.ApkReceiver$1.run(SourceFile:6)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
01-08 12:21:41.919 15078 15348 E Analytics-Core-Analytics: at java.lang.Thread.run(Thread.java:764)
01-08 12:21:41.973  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:41.974  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:42.031 15365 15365 E xiaomi.discove: Not starting debugger since process cannot load the jdwp agent.
01-08 12:21:42.160 15365 15365 E libc    : Access denied finding property "ro.vendor.display.type"
01-08 12:21:42.289   477   508 E cutils  : Failed to mkdirat(/storage/3432-6233/Android/data/com.xiaomi.discover): Read-only file system
01-08 12:21:42.344   477   508 E cutils  : Failed to mkdirat(/storage/3432-6233/Android/data/com.xiaomi.discover): Read-only file system
01-08 12:21:42.974  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:42.974  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:43.662 15365 15419 E SystemUpdate-ConnectionRSA: get key exception : com.android.org.bouncycastle.util.encoders.DecoderException: unable to decode base64 string: invalid characters encountered in base64 data
01-08 12:21:43.975  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:43.975  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:44.976  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:44.976  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:45.977  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:45.977  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:46.978  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:46.979  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:47.980  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:47.980  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:48.892 15342 15438 E libEGL  : validate_display:92 error 3008 (EGL_BAD_DISPLAY)
01-08 12:21:48.981  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:48.981  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:49.064 15342 15349 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb8 in tid 15349 (Jit thread pool), pid 15342 (el.howdoyoufeel)
01-08 12:21:49.293 15448 15448 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-08 12:21:49.293 15448 15448 F DEBUG   : Build fingerprint: 'xiaomi/ginkgo/ginkgo:9/PKQ1.190616.001/V11.0.12.0.PCOMIXM:user/release-keys'
01-08 12:21:49.293 15448 15448 F DEBUG   : Revision: '0'
01-08 12:21:49.293 15448 15448 F DEBUG   : ABI: 'arm'
01-08 12:21:49.294 15448 15448 F DEBUG   : pid: 15342, tid: 15349, name: Jit thread pool  >>> org.howdoyoufeel.howdoyoufeel <<<
01-08 12:21:49.294 15448 15448 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb8
01-08 12:21:49.294 15448 15448 F DEBUG   : Cause: null pointer dereference
01-08 12:21:49.294 15448 15448 F DEBUG   :     r0  00000000  r1  000000c4  r2  000000c4  r3  00000185
01-08 12:21:49.294 15448 15448 F DEBUG   :     r4  000000c5  r5  ccf1d0f0  r6  17770b54  r7  b6198ba7
01-08 12:21:49.294 15448 15448 F DEBUG   :     r8  e18bf68c  r9  0000002e  r10 c7e68da0  r11 00020b27
01-08 12:21:49.294 15448 15448 F DEBUG   :     ip  e93a5cfc  sp  e1b8d4e0  lr  e767ee5f  pc  e767eec6
01-08 12:21:49.319  1548  1829 E libprocessgroup: getpgid(15448) failed: Permission denied
01-08 12:21:49.329  1548  1917 E InputDispatcher: channel 'c9fa83b org.howdoyoufeel.howdoyoufeel/org.kivy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-08 12:21:49.422  1548  3863 E LocationManagerService: request e00fa78 passive Request[POWER_NONE passive fastest=+10s0ms lowPowerMode=false] from com.anddoes.launcher(10248)
01-08 12:21:49.422  1548  3863 E LocationManagerService: provider request: passive ProviderRequest[ON interval=0 lowPowerMode=false]
01-08 12:21:49.463  2066 20244 E ResourceLoader: getXmlRoot local inputStream is null
01-08 12:21:49.463  2066 20244 E ScreenElementRoot: load error, manifest root is null
01-08 12:21:49.502   640  2842 E ANDR-PERF-LM: AdaptiveLaunch: writeToDataBase() 63: Meter aborted or could not get meter data for this run
01-08 12:21:49.984  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:49.984  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:50.986  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:50.986  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:51.378   629  1907 E Diag_Lib:  Diag_LSM_Init: Failed to open handle to diag driver, error = 13
01-08 12:21:51.690   836   996 E storaged: getDiskStats failed with result NOT_SUPPORTED and size 0
01-08 12:21:51.987  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:51.987  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:52.291   629   629 E Diag_Lib:  Diag_LSM_Init: Failed to open handle to diag driver, error = 13
01-08 12:21:52.986  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:52.987  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:53.988  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:53.988  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:54.989  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:54.990  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:55.990  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:55.991  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:56.189 15490 15490 E .android.camer: Not starting debugger since process cannot load the jdwp agent.
01-08 12:21:56.262  1548  1829 E libprocessgroup: Error encountered killing process cgroup uid 99123 pid 9180: No such file or directory
01-08 12:21:56.598 15490 15490 E libc    : Access denied finding property "ro.vendor.display.type"
01-08 12:21:56.991  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:56.991  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:57.992  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:57.993  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:58.896 14841 15524 E Analytics-Core-AndroidUtils: getUidByPackage exception: com.xiaomi.miglobaladsdk
01-08 12:21:58.993  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:58.993  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:59.475 14841 15527 E Analytics-Core-AndroidUtils: getUidByPackage exception: com.xiaomi.miglobaladsdk
01-08 12:21:59.993  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:21:59.994  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:00.995  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:00.995  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:01.996  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:01.997  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:02.998  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:02.998  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:03.997  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:03.997  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:04.998  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:04.999  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:06.001  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:06.001  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:06.518 14841 15538 E Analytics-Core-AndroidUtils: getUidByPackage exception: com.xiaomi.miglobaladsdk
01-08 12:22:07.002  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:07.002  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:08.003  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:08.003  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:09.004  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:09.004  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:09.571   640   708 E ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
01-08 12:22:09.575  1548  3981 E ANDR-PERF-JNI: com_qualcomm_qtiperformance_native_perf_io_prefetch_start
01-08 12:22:09.575   639   639 E ANDR-IOP: IOP HAL: Received pkg_name = org.howdoyoufeel.howdoyoufeel pid = -1
01-08 12:22:09.577   639   704 E ANDR-IOP: io prefetch is disabled
01-08 12:22:10.004  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:10.004  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:10.167  1548  1825 E LocationManagerService: provider request: passive ProviderRequest[ON interval=0 lowPowerMode=false]
01-08 12:22:11.005  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:11.005  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:11.235 15545 15568 E libEGL  : validate_display:92 error 3008 (EGL_BAD_DISPLAY)
01-08 12:22:11.405  1548  1917 E InputDispatcher: channel '14c874d org.howdoyoufeel.howdoyoufeel/org.kivy.android.PythonActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-08 12:22:11.442  1548  1825 E LocationManagerService: provider request: passive ProviderRequest[ON interval=0 lowPowerMode=false]
01-08 12:22:11.589   640  2842 E ANDR-PERF-LM: AdaptiveLaunch: writeToDataBase() 63: Meter aborted or could not get meter data for this run
01-08 12:22:12.005  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:12.006  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:12.639  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:13.007  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:13.007  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:14.008  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
01-08 12:22:14.008  2756  2793 E libc    : Access denied finding property "hwservicemanager.ready"
########


planckp...@gmail.com

unread,
Jan 8, 2021, 2:37:55 PM1/8/21
to Kivy users support
App works fine on my computer.
Necessary, but often not sufficient
I've created a backend API for this app and deployed it on Heroku.
Don't know what this means.

As far as I can see this is not getting as far as Python, and Android is crashing.
So it is a case of Android abuse ;)

It looks like the apk is corrupted.  (build, change app id, build?). Do a

buildozer appclean

and rebuild

Separately, are the urlrequests synchronous? If yes Android will object to the latency.

André Carvalho

unread,
Jan 8, 2021, 6:56:14 PM1/8/21
to Kivy users support
Don't know what this means.
I mean that kivy application is just the frontend. This app communicates with an REST API build with Django to do its tricks.

Are the urlrequests synchronous? If yes Android will object to the latency.
Yes, they are synchronous indeed. And they're written like that just because of my limited knowledge. I really discover async Python requests as I researched now that you asked me about it. I already figured out how to do async requests, but I think this app isn't crashing because the synchronous requests, as it didn't even get to the start screen (no requests involved to get there, it's just a simple screen). Or Android will object about it even BEFORE any request is dispatched?

I did run buildozer appclean and recompiled the app with buildozer android debug (I don't know even if it's the best command to do it so), and the results are the same: app crashes right after loading screen, not showing anything I've written. I will proceed altering the request type (using the asyncio module) and try to run it again.

Oh, and I forgot to put here the buildozer.spec lines. If there's something that you see, I would really appreciate any help:

buildozer.spec
########
[app]

# (str) Title of your application
title = How do you feel

# (str) Package name
package.name = howdoyoufeel

# (str) Package domain (needed for android/ios packaging)
package.domain = org.howdoyoufeel

# (str) Source code where the main.py live
source.dir = .

# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas

# (list) List of inclusions using pattern matching
#source.include_patterns = assets/*,images/*.png

# (list) Source files to exclude (let empty to not exclude anything)
#source.exclude_exts = spec

# (list) List of directory to exclude (let empty to not exclude anything)
#source.exclude_dirs = tests, bin, venv

# (list) List of exclusions using pattern matching
#source.exclude_patterns = license,images/*/*.jpg

# (str) Application versioning (method 1)
version = 0.1

# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy

# (str) Custom source folders for requirements
# Sets custom source for any requirements with recipes
# requirements.source.kivy = ../../kivy

# (str) Presplash of the application
#presplash.filename = %(source.dir)s/data/presplash.png

# (str) Icon of the application
#icon.filename = %(source.dir)s/data/icon.png

# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all)
orientation = all

# (list) List of service to declare
#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

#
# OSX Specific
#

#
# author = © Copyright Info

# change the major version of python used by the app
osx.python_version = 3

# Kivy version to use
osx.kivy_version = 1.9.1

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 0

# (string) Presplash background color (for android toolchain)
# Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
# olive, purple, silver, teal.
#android.presplash_color = #FFFFFF

# (string) Presplash animation using Lottie format.
# for general documentation.
# Lottie files can be created using various tools, like Adobe After Effect or Synfig.
#android.presplash_lottie = "path/to/lottie/file.json"

# (list) Permissions
#android.permissions = INTERNET

# (list) features (adds uses-feature -tags to manifest)
#android.features = android.hardware.usb.host

# (int) Target Android API, should be as high as possible.
#android.api = 27

# (int) Minimum API your APK will support.
#android.minapi = 21

# (int) Android SDK version to use
#android.sdk = 20

# (str) Android NDK version to use
#android.ndk = 19b

# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi.
#android.ndk_api = 21

# (bool) Use --private data storage (True) or --dir public storage (False)
#android.private_storage = True

# (str) Android NDK directory (if empty, it will be automatically downloaded.)
#android.ndk_path =

# (str) Android SDK directory (if empty, it will be automatically downloaded.)
#android.sdk_path =

# (str) ANT directory (if empty, it will be automatically downloaded.)
#android.ant_path =

# (bool) If True, then skip trying to update the Android sdk
# This can be useful to avoid excess Internet downloads or save time
# when an update is due and you just want to test/build your package
# android.skip_update = False

# (bool) If True, then automatically accept SDK license
# agreements. This is intended for automation only. If set to False,
# the default, you will be shown the license when first running
# buildozer.
# android.accept_sdk_license = False

# (str) Android entry point, default is ok for Kivy-based app
#android.entrypoint = org.renpy.android.PythonActivity

# (str) Android app theme, default is ok for Kivy-based app
# android.apptheme = "@android:style/Theme.NoTitleBar"

# (list) Pattern to whitelist for the whole project
#android.whitelist =

# (str) Path to a custom whitelist file
#android.whitelist_src =

# (str) Path to a custom blacklist file
#android.blacklist_src =

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (list) Android AAR archives to add
#android.add_aars =

# (list) Gradle dependencies to add
#android.gradle_dependencies =

# (list) add java compile options
# this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option
# android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8"

# (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies}
# please enclose in double quotes 
# e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }"
#android.add_gradle_repositories =

# (list) packaging options to add 
# can be necessary to solve conflicts in gradle_dependencies
# please enclose in double quotes 
# e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'"
#android.add_packaging_options =

# (list) Java classes to add as activities to the manifest.
#android.add_activities = com.example.ExampleActivity

# (str) OUYA Console category. Should be one of GAME or APP
# If you leave this blank, OUYA support will not be enabled
#android.ouya.category = GAME

# (str) Filename of OUYA Console icon. It must be a 732x412 png image.
#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png

# (str) XML file to include as an intent filters in <activity> tag
#android.manifest.intent_filters =

# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard

# (list) Android additional libraries to copy into libs/armeabi
#android.add_libs_armeabi = libs/android/*.so
#android.add_libs_armeabi_v7a = libs/android-v7/*.so
#android.add_libs_arm64_v8a = libs/android-v8/*.so
#android.add_libs_x86 = libs/android-x86/*.so
#android.add_libs_mips = libs/android-mips/*.so

# (bool) Indicate whether the screen should stay on
# Don't forget to add the WAKE_LOCK permission if you set this to True
#android.wakelock = False

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (list) Android library project to add (will be added in the
# project.properties automatically.)
#android.library_references =

# (list) Android shared libraries which will be added to AndroidManifest.xml using <uses-library> tag
#android.uses_library =

# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D

# (bool) Copy library instead of making a libpymodules.so
#android.copy_libs = 1

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64
android.arch = armeabi-v7a

# (int) overrides automatic versionCode computation (used in build.gradle)
# this is not the same as app version and should only be edited if you know what you're doing
# android.numeric_version = 1

# (bool) enables Android auto backup feature (Android API >=23)
android.allow_backup = True

# (str) XML file for custom backup rules (see official auto backup documentation)
# android.backup_rules =

# (str) If you need to insert variables into your AndroidManifest.xml file,
# you can do so with the manifestPlaceholders property.
# This property takes a map of key-value pairs. (via a string)
# Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"]
# android.manifest_placeholders = [:]

#
# Python for android (p4a) specific
#

# (str) python-for-android fork to use, defaults to upstream (kivy)
#p4a.fork = kivy

# (str) python-for-android branch to use, defaults to master
#p4a.branch = master

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

# (str) The directory in which python-for-android should look for your own build recipes (if any)
#p4a.local_recipes =

# (str) Filename to the hook for p4a
#p4a.hook =

# (str) Bootstrap to use for android builds
# p4a.bootstrap = sdl2

# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =

# Control passing the --use-setup-py vs --ignore-setup-py to p4a
# "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not
# Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py
# NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate
# setup.py if you're using Poetry, but you need to add "toml" to source.include_exts.
#p4a.setup_py = false


#
# iOS specific
#

# (str) Path to a custom kivy-ios folder
#ios.kivy_ios_dir = ../kivy-ios
# Alternately, specify the URL and branch of a git checkout:
ios.kivy_ios_branch = master

# Another platform dependency: ios-deploy
# Uncomment to use a custom checkout
#ios.ios_deploy_dir = ../ios_deploy
# Or specify URL and branch
ios.ios_deploy_branch = 1.10.0

# (bool) Whether or not to sign the code
ios.codesign.allowed = false

# (str) Name of the certificate to use for signing the debug version
# Get a list of available identities: buildozer ios list_identities
#ios.codesign.debug = "iPhone Developer: <lastname> <firstname> (<hexstring>)"

# (str) Name of the certificate to use for signing the release version
#ios.codesign.release = %(ios.codesign.debug)s


[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1

# (str) Path to build artifact storage, absolute or relative to spec file
# build_dir = ./.buildozer

# (str) Path to build output (i.e. .apk, .ipa) storage
# bin_dir = ./bin

#    -----------------------------------------------------------------------------
#    List as sections
#
#    You can define all the "list" as [section:key].
#    Each line will be considered as a option to the list.
#    Let's take [app] / source.exclude_patterns.
#    Instead of doing:
#
#[app]
#source.exclude_patterns = license,data/audio/*.wav,data/images/original/*
#
#    This can be translated into:
#
#[app:source.exclude_patterns]
#license
#data/audio/*.wav
#data/images/original/*
#


#    -----------------------------------------------------------------------------
#    Profiles
#
#    You can extend section / key with a profile
#    For example, you want to deploy a demo version of your application without
#    HD content. You could first change the title to add "(demo)" in the name
#    and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
#    Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

########

planckp...@gmail.com

unread,
Jan 8, 2021, 7:42:19 PM1/8/21
to Kivy users support
The first crash was not related to async, I was just looking ahead.

Look at the logcat I expect the error will be different (at least if I was right about corrupted).

Looking ahead, sooner or later you will see a message in the logcat from Python - missing symbol
It should be the name of a pip3 package that must be added to 'requirements'
Because Buildozer needs to know what external packages must be installed in the apk.
(some are automatic, the easiest way not to add extra stuff is to just add to requirements till this message goes away)
Reply all
Reply to author
Forward
0 new messages