Posts

Showing posts with the label Kivy

Buildozer Failed To Execute The Last Command

Answer : First raise the log level = 2 in buildozer.spec ,then it will show all logs and error clearly. Here in .buildozer/android/platform/python-for-android/dist/myapp/python 2.7 build.py was missing. To fix this issue run this command buildozer android clean and then rebuild it using buildozer android debug or automatically run using buildozer android debug deploy run . Probably you are running an updated version of cython, all major release start form 0.21 and up, you have to downgrade cython to 0.20 ( sudo pip install cython==0.20 ) then removing .buildozer folder ( rm -Rf .buildozer ) and then rebuilding with 'buildozer android debug'

Bind Function To Kivy Button

Answer : I don't think any of the answers are very clear. Neither explains that problem is that the callback given to on_press gets called with a parameter, the instance of button, so LoginScreen.auth must accept a parameter after the self : def auth(self, button): print('button pressed:', instance) The problem is not that on_press must be given via Button.bind or that the callback must be a function, it can be a bound method, and the docs cited by other answer and by comments link to ButtonbBhavior which indicates that OP use of on_press in constructor was fine: self.hello = Button(text="hello", on_press=self.auth) would have worked if auth had been as described above. If you read the Button documentation, the key seems to be to use the bind function: def callback(instance): print('The button <%s> is being pressed' % instance.text) btn1 = Button(text='Hello world 1') btn1.bind(on_press=callback)