-
Notifications
You must be signed in to change notification settings - Fork 506
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
How to make third party site-packages 'requests' run on Android. #1021
Comments
Logs
|
you need |
import certifi I add above code to main.py, and 'requirements = python3, kivy, certifi, openssl, android' in buildozer.spec file; then buildozer, but 'requests' module still not working on mobile phone. |
@tshirtman |
Same Problem |
use logcat to see what happens when the app tries to import/use requests, we can't just guess what the error is. |
same problem. it just says: [08-17 10:29:33.649 3476:3502 I/python] [08-17 10:29:33.649 3476:3502 I/python] [08-17 10:29:33.650 3476:3502 I/python] [08-17 10:29:33.650 3476:3502 I/python] [08-17 10:29:33.651 3476:3502 I/python] [08-17 10:29:33.651 3476:3502 I/python] |
same problem |
Does adding charted to requirements line in requirements work ? |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have the means to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
Version
Description
I successfully built the code into apk, and can open it normally on Android phone.
But the HTTP requests library is not working properly.
The code runs normally in PyCharm and Python IDE.
###Part of Code
`
#!/usr/bin/python3
-- coding: utf-8 --
import requests
import kivy
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.clock import Clock
from functools import partial
kivy.require('1.11.1')
def net_det(self, *args):
url = r'http://192.168.0.178' //(Android mobile browser can access this address normally)
try: //(While this part not working properly)
det = requests.get(url, timeout=3)
if det.status_code == 200:
sm.current = "Switch"
except: //(run on mobile, Always result to ''Failed!...." screen)
MyApp.rp.message.text = "Failed! \n\nPlease contact system administrator!"
MyApp.rp.layout2.remove_widget(MyApp.rp.rbtn)
sm.current = "Result"
`
buildozer.spec
###Spec file:
The text was updated successfully, but these errors were encountered: