python, kivy, geopy, buildozer - python

I have successfully compiled a few android packages with buildozer (e.g 'openweather' works just fine with an API key).
My Kivy file works fine.
When I include geopy, buildozer successfully compiles the kivy file, but the app crashes when I ask for the Lat/Lon position.
I have an API key from Nominatim/MapQuest:
in the 'main.py file': user_agent='API_key' or 'app_name' or my email address
in the buildozer'spec file':
requirements: pytyhon3, kivy, geopy
android.permissions= INTERNET
My question, what am I doing wrong?
Regards
Sybe

The permissions should be android.permissions = INTERNET, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, if you need access to the devices gps.
Try to rebuilding your app with those permissions included and post the logcat output if it still crashes

Related

pydroid3 python program converted to android app with buildozer will not start on android How can I debug?

I created a kivy app in python using pydroid3 It is quite simple, a single button. It works on the android device when run from pydroid3.
I successfully converted the python app to an android app using bulldozer.
Primary Question
I cannot get any debug feedback from the android device as to why the application crashes at start-up.
Can someone help find the location of some sort of android logs similar to syslog or PHP log in Ubuntu.
Here is what I have done to solve this problem myself:
I found documentation on how to properly configure the conversion with buildozer.spec. Soon I realized that I was adding all the python modules involved in the program - but most documentation says that buildozer scans the original files and imports the necessary modules, but still after numerous failures, I added as many as I determined needed to be included.
Each time I start the app on the android 10 device (a radio head), it just crashes upon opening. No error messages etc. I find it unexpected that there is no way to view some kind of Syslog in android. But still, I continued.
I installed android desktop (AD) on my Mac laptop and then connected it to the android head unit and setup the unit to allow USB debugging. I was able to get AD to spew out endless lines of real-time data in the Logcat display.
I was not able to identify anything related to my app in the output provided by logcat: a search using the filter resulted in nothing associated with my app's name. Further, nothing shows up searching for "error" "failure, "failure to load," etc -- that might have given me a clue.
Next Question
Are there any documents related to how to create a program in python, using buildozer, and then install and debug the app in android?
I am sure this is one simple missing module or a similar issue that should be glaring in an error log somewhere.
Thanks for any help.
Jack
.
see the information above

App doesn't work after using Kivy/Buildozer

I use buildozer android debug deploy run to install my app on my android and my app installs but I can't run it on my phone
Here is my .spec file I got spam error so I send link to google drive
https://docs.google.com/document/d/1Rn1xDuWcGSvZsDVLVKeGUdwOtRtE1nNzJd91EHYmXwM/edit?usp=drivesdk
I am new to kivy and buildozer so can you tell me what I am doing wrong or what else should I attach to this post.And also I use some python build in modules in my project. Do I have to add them in requirements?

How to package a Kivy application for Android from a Windows machine?

So I was following along this Python tutorial teaching how to make a mobile app using Kivy, and at the end they used Buildozer to package it for Android. I discovered that Buildozer doesn't work for Windows. I tried looking for other ways, but have not found any straightforward way that works for Windows.
Would anyone be able to link me a relevant instruction page or explain how can I package my Kivy app for Android from a Windows WITHOUT using a virtual machine?

APK How to use Android Bundle for fix GooglePlay Error

I'm just finished my coding and trying to upload to Google Play. Actually it's hard to upload just like coding:) So, I had to learn something about SDK and architect. I figured out how to fix'em and use. But at the end, when I'm trying to upload on GooglePlay, I'm getting this error.
ERROR (Actually warning):
Unoptimized APK Warning:
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices.
Resolution:
Use the Android App Bundle to automatically optimize for device configurations, or manage it yourself with multiple APKs.
I didn't see any "pass" button or smt. Like that for this WARNING. So I think I have to fix that first.
I checked websites for solution but couldn't find anything for non coding on Android Studio apks. I mean, I coded this apk on PyCharm then created with buildozer after signed by keytool. The main question is, how can I generate signed bundle apk on Android Studio, with my created APK or coded .py files.
I never built an Android app in this way but I understand your problem [and your frustration]
I gave a look around and I found this:
If you don't want to use Android Studio or Gradle tasks to build
bundles — for example, if you use a custom build toolchain — you
can use bundletool from the command line to build an app bundle from
pre-compiled code and resources. If you haven't already done so,
download bundletool from the GitHub repository

Logs Generated when launching an App in Kivy Launcher on Android

I know we can launch an app in Android using Kivy launcher for android https://play.google.com/store/apps/details?id=org.kivy.pygame
and i can launch apps by the same as well . But i need to know how and where can we see the logs generated by the app in it ? For example if i run kivy app on my desktop i will be able to see logs on console but where will i find them when launching an app by kivy launcher ?
If we cant see logs is there any ways to make this possible ?
On android, kivy prints all python's normal terminal output to the android logcat stream. You can view this from the desktop by connecting your phone via usb and doing adb logcat. adb is provided by the android sdk, so if it's not in your path you can probably find it there. If you use buildozer, I think you can access its auto-downloaded android sdk using
buildozer android logcat
You can also view the adb output using some apps on the play store (may only work with older android versions though, I think something changed here).
Kivy may also store logs as text files somewhere on the sd card, possibly in the app directory (i.e. somewhere in the kivy launcher's kivy directory), but I haven't ever really used this, adb is a lot more convenient.
When your application is executed a .kivy folder will be created (if not already there).
In it you'll see a logs folder. The logs there are the same obtained via "adb logcat".

Categories