-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
App crashes when sending POST request http #1329
Comments
Very nice bug report thanks. One thing you could add and maybe it will help you to solve the bug yourself is the logcat trace. What I usually do is: buildozer android adb -- logcat | grep -i python Most of the time it's enough for me to see the actual error on the remote device. Please give it a try and let us know. It would be a real plus if you could share the relevant part of the adb trace. |
Thanks for the quick response. There seems to be a problem with parse. Any idea what to do?
|
You probably need to |
Jeah, just realized that. It's added to the main.py now and compiling pray |
Now when I open the app it crashes. This is home my import looks:
And here the logcat. Do I have to adjust the spec file? |
Yes totally you need to fix your software to work for Python2. See urlparse documentation https://docs.python.org/2/library/urlparse.html
So basically what happens probably is your software runs fine on host because you're running on Python3 on your host.
But that's not really a p4a issue 😕 |
Sorry, I am a bit lost.. on my local machine I run the app with Python 2.7 |
In this case I would be curious to see the exact output of your: python -c "import urllib.parse; print(urllib.parse)" As well as a |
For python 3 You should do: For python 2 you should do: |
To accommodate both python 2 and 3:try: |
Thanks very much. Which req would I have to put in the spec file? |
You don't have to add a requirement for that. Urllib is part of the Python standard library. What I mean is that, hostpython2 if you're using python 2 or hostpython3 if you're using python3 is just good enough a requirement for urllib as urllib is part of the python standard libtary. |
Perfect, thanks! Ok, so finally I've managed to have it run on Python 2.7 |
Just wanted to thank you guys for your help! Just deployed and now it's working as expected! Really great community support, keep it up!! This can be closed |
Glad you could fix your issue. Even though it wasn't directly related to a kivy issue, feel free to share what were the pitfalls new kivy users may come across. Perhaps the fix on kivy side is to improve the documentation (e.g. how-to debug on Android...) or drop python2.7 support completely. |
Gladly will, my biggest issue was the version control with PyCharm. I derive from your comment that you suggest to go with Python 3.6 @AndreMiras correct? Well, then that's something I'd also consider. If there is somebody who'd like to keep on developing the www.myinv.org app with me, let me know :-) |
Yes I would recommend to go full Python 3.6 indeed. |
kivy_myinv_url
Login App POST request
The app built with kivy on Python 2.7 sends an HTTP POST REQUEST to www.myinv.org/login and processes the return.
Now comes the odd part: Once I create the apk with buildozer (I'm using using the VM 17.04) the app crashes.
On my local machine the app works.
When clicking the login button in the app, it fails at the following point:
main.kv
main.py
Any idea why this goes wrong? Please see the files in the rep
On the VM I can only build using the command:
The command which comes in the readme does not work:
Before building new apks I use:
buildozer.spec
The text was updated successfully, but these errors were encountered: