kivy / python-for-android

Turn your Python application into an Android APK
https://python-for-android.readthedocs.io
MIT License
8.33k stars 1.84k forks source link

App crashes when sending POST request http #1329

Closed Mark-Wellings closed 6 years ago

Mark-Wellings commented 6 years ago

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

Button:
            color: 0,1,0,1
            text: 'Login'
            font_size: 30
            size: self.size
            on_press: root.http_request_myinv(login.text,password.text)

main.py

def http_request_myinv(self,username, password_in):

    self.username = username
    self.password_in = password_in
    print (username,password_in)
    print ("http-start")
    params = urllib.parse.urlencode({'username': 'mwell', 'password': password_in})
    headers = {'Content-type': 'application/x-www-form-urlencoded',
               'Accept': 'text/plain'}

    self.request = UrlRequest('https://www.myinv.org/login', req_body=params,    req_headers=headers,on_success=self.login_validate)
    print(self.request)
    print("Result: ", self.request.result)  

Any idea why this goes wrong? Please see the files in the rep

On the VM I can only build using the command:

buildozer android debug deploy run

The command which comes in the readme does not work:

buildozer android_new debug deploy run

Before building new apks I use:

buildozer android debug clean

buildozer.spec

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

  # (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

  # (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 seperated e.g. requirements = sqlite3,kivy
  requirements = kivy, urllib3, openssl

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

  # (list) Garden requirements
  #garden_requirements =

  # (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, portrait or all)
  orientation = portrait

  # (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 new 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

  # (list) Permissions
  android.permissions = INTERNET, ACCESS_NETWORK_STATE

  # (int) Android API to use
  #android.api = 19

  # (int) Minimum API required
  #android.minapi = 9

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

  # (str) Android NDK version to use
  #android.ndk = 9c

  # (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

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

  # (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 (currently works only with sdl2_gradle
  # bootstrap)
  #android.add_aars =

  # (list) Gradle dependencies to add (currently works only with sdl2_gradle
  # bootstrap)
  #android.gradle_dependencies =

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

  # (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 =

  # (list) Android additionnal 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_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 =

  # (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
  android.arch = armeabi-v7a

  #
  # Python for android (p4a) specific
  #

  # (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

  #
  # iOS specific
  #

  # (str) Path to a custom kivy-ios folder
  #ios.kivy_ios_dir = ../kivy-ios

  # (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 = /home/kivy/Desktop/build/

  # (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
AndreMiras commented 6 years ago

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.

Mark-Wellings commented 6 years ago

Thanks for the quick response. There seems to be a problem with parse. Any idea what to do?

08-12 21:03:41.077  8097  8159 D GOS:PkgData: PkgData(), pkgName: com.sololearn.python
08-12 21:03:41.077  8097  8159 D GOS:PkgData: setCustomFeatureFlag, pkgName: com.sololearn.python, old featureFlag: 346781844236309267, new featureFlag: 22518273019130647
08-12 21:07:51.117  3669  3669 I ActivityManager: Start proc 10511:org.testmyinv.myinv:python/u0a253 for activity org.testmyinv.myinv/org.renpy.android.PythonActivity
08-12 21:07:51.122 10511 10511 I SELinux : SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=org.testmyinv.myinv:python 
08-12 21:07:51.190  3669  4113 I ActivityManager: START u0 {act=android.intent.action.MAIN typ=null flg=0x10200000 cmp=ComponentInfo{org.testmyinv.myinv/org.renpy.android.PythonActivity}} from uid 10080
08-12 21:07:51.223  3669  5035 D ActivityManager: applyOptionsLocked, ANIM_CUSTOM_SCALE_UP, task.getRootActivity() : ActivityRecord{6e8e5be u0 org.testmyinv.myinv/org.renpy.android.PythonActivity t224}, task.getTaskToReturnTo() : 1
08-12 21:07:51.228  3669  3977 D GameManagerService: handleForegroundChange(). pkgName: org.testmyinv.myinv, clsName: org.renpy.android.PythonActivity,FgActivityName:org.testmyinv.myinv/org.renpy.android.PythonActivity
08-12 21:07:51.364  3669  3808 D MdnieScenarioControlService:  packageName : org.testmyinv.myinv    className : org.renpy.android.PythonActivity
08-12 21:07:51.375 10511 10511 V python  : metadata fullscreen is0
08-12 21:07:51.429 10511 10529 W linker  : /data/app/org.testmyinv.myinv-7WU36wwb1L7FAtlbRgzjFA==/lib/arm/libpython2.7.so: is missing DT_SONAME will use basename as a replacement: "libpython2.7.so"
08-12 21:07:51.430 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: setView = DecorView@cf96761[PythonActivity] TM=true MM=false
08-12 21:07:51.436 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: dispatchAttachedToWindow
08-12 21:07:51.438 10511 10529 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_io.so: is missing DT_SONAME will use basename as a replacement: "_io.so"
08-12 21:07:51.438  3669 10533 V WindowManager: Relayout Window{dc8dfff u0 org.testmyinv.myinv/org.renpy.android.PythonActivity}: viewVisibility=0 req=1440x2464 WM.LayoutParams{(0,0)(fillxfill) sim=#123 ty=1 fl=#1810100 wanim=0x10302ea needsMenuKey=2 colorMode=0 naviIconColor=0}
08-12 21:07:51.441  3204  3204 I SurfaceFlinger: id=810 createSurf (1440x2560),1 flag=404, org.testmyinv.myinv/org.renpy.android.PythonActivity#0
08-12 21:07:51.441 10511 10529 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/unicodedata.so: is missing DT_SONAME will use basename as a replacement: "unicodedata.so"
08-12 21:07:51.445 10511 10529 I python  : Starting audio thread
08-12 21:07:51.448 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1440,2560] result=0x7 surface={valid=true 3720466432} changed=true
08-12 21:07:51.456 10511 10530 D libGLESv1: STS_GLApi : DTS, ODTC are not allowed for Package : org.testmyinv.myinv:python
08-12 21:07:51.462  3204  3204 I SurfaceFlinger: id=811 createSurf (1440x2464),4 flag=404, SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:07:51.463  3204  3204 I SurfaceFlinger: id=812 createSurf (1440x2464),-1 flag=20404, Background for - SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:07:51.464 10511 10511 D SurfaceView: BG show() Surface(name=Background for - SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0) org.renpy.android.SDLSurfaceView{5a27b74 V.E...... ......ID 0,0-1440,2464}
08-12 21:07:51.484 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1440, 2560) ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
08-12 21:07:51.485 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: MSG_WINDOW_FOCUS_CHANGED 1
08-12 21:07:51.498  3669  4415 V WindowManager: Relayout Window{dc8dfff u0 org.testmyinv.myinv/org.renpy.android.PythonActivity}: viewVisibility=0 req=1440x2560 WM.LayoutParams{(0,0)(fillxfill) sim=#23 ty=1 fl=#1810100 fmt=-3 wanim=0x10302ea needsMenuKey=2 colorMode=0 naviIconColor=0}
08-12 21:07:51.500 10511 10545 I python  : presplash-fit is null
08-12 21:07:51.502 10511 10545 I python  : presplash (fit=null) mx=1,406250,my=2,406250
08-12 21:07:51.504 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: Relayout returned: old=[0,0][1440,2560] new=[0,0][1440,2560] result=0x3 surface={valid=true 3720466432} changed=false
08-12 21:07:51.536  3669  4415 V WindowManager: finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING Window{dc8dfff u0 org.testmyinv.myinv/org.renpy.android.PythonActivity} in Surface(name=org.testmyinv.myinv/org.renpy.android.PythonActivity)
08-12 21:07:51.553  3669  3697 I ActivityManager: Displayed org.testmyinv.myinv/org.renpy.android.PythonActivity: +318ms
08-12 21:07:51.559 10511 10545 I python  : Initialize Python for Android
08-12 21:07:51.572  3204  3204 D SurfaceFlinger:        HWC | 79d682d780 | 0000 | 0020 | 00 | 0100 | RGBA_8888   |    0.0,    0.0, 1440.0, 2464.0 |    0,   96, 1440, 2560 | SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:07:51.572  3204  3204 D SurfaceFlinger:        HWC | 79d254b200 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1440.0,   96.0 |    0,    0, 1440,   96 | org.testmyinv.myinv/org.renpy.android.PythonActivity#0
08-12 21:07:51.642 10511 10545 I python  : ['/data/user/0/org.testmyinv.myinv/files/lib/python2.7/site-packages', '/data/user/0/org.testmyinv.myinv/files/lib/site-python']
08-12 21:07:51.642 10511 10545 I python  : Android path ['/data/user/0/org.testmyinv.myinv/files/lib/python27.zip', '/data/user/0/org.testmyinv.myinv/files/lib/python2.7', '/data/user/0/org.testmyinv.myinv/files/lib/python2.7/lib-dynload', '/data/user/0/org.testmyinv.myinv/files/lib/python2.7/site-packages', '/data/user/0/org.testmyinv.myinv/files', '/data/user/0/org.testmyinv.myinv/files/_applibs']
08-12 21:07:51.642 10511 10545 I python  : Android kivy bootstrap done. __name__ is __main__
08-12 21:07:51.642 10511 10545 I python  : Run user program, change dir and execute main.py
08-12 21:07:51.684 10511 10545 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_hashlib.so: is missing DT_SONAME will use basename as a replacement: "_hashlib.so"
08-12 21:07:51.705  3669  3808 D MdnieScenarioControlService:  packageName : org.testmyinv.myinv    className : org.renpy.android.PythonActivity
08-12 21:07:51.777 10511 10545 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.testmyinv.myinv/files/.kivy/logs/kivy_18-08-12_4.txt
08-12 21:07:51.777 10511 10545 I python  : [INFO   ] [Kivy        ] v1.10.1
08-12 21:07:51.777 10511 10545 I python  : [INFO   ] [Python      ] v2.7.2 (default, Aug 12 2018, 13:35:04) 
08-12 21:07:51.777 10511 10545 I python  : [GCC 4.8]
08-12 21:07:51.794 10511 10545 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_ctypes.so: is missing DT_SONAME will use basename as a replacement: "_ctypes.so"
08-12 21:07:51.818 10511 10545 I python  : [INFO   ] [Factory     ] 194 symbols loaded
08-12 21:07:52.288 10511 10545 I python  :  /data/user/0/org.testmyinv.myinv/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
08-12 21:07:52.289 10511 10545 I python  :  (ImportError: No module named cdrom)
08-12 21:07:52.303 10511 10545 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil, img_ffpyplayer ignored)
08-12 21:07:52.323 10511 10545 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_ssl.so: is missing DT_SONAME will use basename as a replacement: "_ssl.so"
08-12 21:07:52.360 10511 10545 I python  : [INFO   ] [Text        ] Provider: pygame
08-12 21:07:52.811 10511 10545 I python  : [INFO   ] [Window      ] Provider: pygame
08-12 21:07:52.817 10511 10545 I python  : [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
08-12 21:07:52.818 10511 10545 I python  : [INFO   ] [GL          ] Backend used <gl>
08-12 21:07:52.819 10511 10545 I python  : [INFO   ] [GL          ] OpenGL version <OpenGL ES 3.2 v1.r22p0-01rel0.f294e54ceb2cb2d81039204fa4b0402e>
08-12 21:07:52.820 10511 10545 I python  : [INFO   ] [GL          ] OpenGL vendor <ARM>
08-12 21:07:52.820 10511 10545 I python  : [INFO   ] [GL          ] OpenGL renderer <Mali-T880>
08-12 21:07:52.820 10511 10545 I python  : [INFO   ] [GL          ] OpenGL parsed version: 3, 2
08-12 21:07:52.821 10511 10545 I python  : [INFO   ] [GL          ] Texture max size <8192>
08-12 21:07:52.821 10511 10545 I python  : [INFO   ] [GL          ] Texture max units <16>
08-12 21:07:52.825 10511 10545 D libGLESv2: STS_GLApi : DTS, ODTC are not allowed for Package : org.testmyinv.myinv:python
08-12 21:07:52.830 10511 10545 I python  : [INFO   ] [Support     ] Android install hooks
08-12 21:07:52.831 10511 10545 I python  : [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
08-12 21:07:53.061 10511 10545 I python  : [WARNING] [Lang        ] The file /data/data/org.testmyinv.myinv/files/main.kv is loaded multiples times, you might have unwanted behaviors.
08-12 21:07:53.077 10511 10545 I python  : [WARNING] [Factory     ] Ignored class "MultiSelectOption" re-declaration. Current -  module: None, cls: None, baseclass: ToggleButton, filename: /data/data/org.testmyinv.myinv/files/main.kv. Ignored -  module: None, cls: None, baseclass: ToggleButton, filename: /data/data/org.testmyinv.myinv/files/main.kv.
08-12 21:07:53.155 10511 10545 I python  : [INFO   ] [Base        ] Start application main loop
08-12 21:07:53.155 10511 10545 I python  : [INFO   ] [Android     ] found 17 joystick
08-12 21:07:53.155 10511 10545 I python  : [INFO   ] [Android     ] create joystick <0>
08-12 21:07:53.155 10511 10545 I python  : [INFO   ] [Android     ] discard joystick <0> cause no button
08-12 21:07:53.156 10511 10545 I python  : [INFO   ] [Android     ] create joystick <1>
08-12 21:07:53.156 10511 10545 I python  : [INFO   ] [Android     ] create joystick <2>
08-12 21:07:53.156 10511 10545 I python  : [INFO   ] [Android     ] create joystick <3>
08-12 21:07:53.156 10511 10545 I python  : [INFO   ] [Android     ] create joystick <4>
08-12 21:07:53.157 10511 10545 I python  : [INFO   ] [Android     ] create joystick <5>
08-12 21:07:53.157 10511 10545 I python  : [INFO   ] [Android     ] create joystick <6>
08-12 21:07:53.157 10511 10545 I python  : [INFO   ] [Android     ] create joystick <7>
08-12 21:07:53.158 10511 10545 I python  : [INFO   ] [Android     ] create joystick <8>
08-12 21:07:53.158 10511 10545 I python  : [INFO   ] [Android     ] create joystick <9>
08-12 21:07:53.158 10511 10545 I python  : [INFO   ] [Android     ] create joystick <10>
08-12 21:07:53.158 10511 10545 I python  : [INFO   ] [Android     ] create joystick <11>
08-12 21:07:53.159 10511 10545 I python  : [INFO   ] [Android     ] create joystick <12>
08-12 21:07:53.159 10511 10545 I python  : [INFO   ] [Android     ] create joystick <13>
08-12 21:07:53.159 10511 10545 I python  : [INFO   ] [Android     ] create joystick <14>
08-12 21:07:53.160 10511 10545 I python  : [INFO   ] [Android     ] create joystick <15>
08-12 21:07:53.160 10511 10545 I python  : [INFO   ] [Android     ] create joystick <16>
08-12 21:07:53.554 10511 10545 I python  : [INFO   ] [GL          ] NPOT texture support is available
08-12 21:07:53.577 10511 10545 I python  : [WARNING] [Base        ] Failed to import "android" module. Could not remove android presplash.
08-12 21:09:06.458 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 0
08-12 21:09:06.483 10511 10545 I python  : (u'', u'')
08-12 21:09:06.484 10511 10545 I python  : http-start
08-12 21:09:06.485 10511 10545 I python  : [INFO   ] [Base        ] Leaving application in progress...
08-12 21:09:06.486 10511 10545 I python  :  Traceback (most recent call last):
08-12 21:09:06.486 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/app/main.py", line 184, in <module>
08-12 21:09:06.487 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/app.py", line 826, in run
08-12 21:09:06.488 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 502, in runTouchApp
08-12 21:09:06.489 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 403, in mainloop
08-12 21:09:06.490 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 289, in _mainloop
08-12 21:09:06.490 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 340, in idle
08-12 21:09:06.491 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 325, in dispatch_input
08-12 21:09:06.492 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 231, in post_dispatch_input
08-12 21:09:06.493 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.493 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/__init__.py", line 1360, in on_motion
08-12 21:09:06.494 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.495 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/__init__.py", line 1376, in on_touch_down
08-12 21:09:06.495 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.496 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/screenmanager.py", line 1191, in on_touch_down
08-12 21:09:06.498 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:09:06.499 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.499 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/relativelayout.py", line 288, in on_touch_down
08-12 21:09:06.501 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:09:06.501 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.502 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:09:06.503 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.503 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:09:06.504 10511 10545 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:09:06.505 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/behaviors/button.py", line 151, in on_touch_down
08-12 21:09:06.506 10511 10545 I python  :    File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8147)
08-12 21:09:06.506 10511 10545 I python  :    File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch (kivy/_event.c:14036)
08-12 21:09:06.507 10511 10545 I python  :    File "kivy/_event.pyx", line 1098, in kivy._event.EventObservers._dispatch (kivy/_event.c:12817)
08-12 21:09:06.508 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang/builder.py", line 64, in custom_callback
08-12 21:09:06.508 10511 10545 I python  :    File "/data/data/org.testmyinv.myinv/files/main.kv", line 93, in <module>
08-12 21:09:06.509 10511 10545 I python  :      on_press: root.http_request_myinv(login.text,password.text)
08-12 21:09:06.510 10511 10545 I python  :    File "/home/kivy/Desktop/build/android/app/main.py", line 79, in http_request_myinv
08-12 21:09:06.510 10511 10545 I python  :  AttributeError: 'module' object has no attribute 'parse'
08-12 21:09:06.564 10511 10511 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 1
08-12 21:09:06.596 10511 10545 I python  : Python for android ended.
08-12 21:09:06.663  3669  5035 I ActivityManager: Process org.testmyinv.myinv:python (pid 10511) has died: fore TOP (124,1697)
08-12 21:09:06.665  3204  3204 I SurfaceFlinger: id=811 Removed SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0 (1/5)
08-12 21:09:06.665  3204  3204 I SurfaceFlinger: id=812 Removed Background for - SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0 (0/5)
08-12 21:09:06.665  3669  4113 I WindowManager: WIN DEATH: Window{dc8dfff u0 org.testmyinv.myinv/org.renpy.android.PythonActivity}
08-12 21:09:06.666  3669  5035 W ActivityManager: Force removing ActivityRecord{6e8e5be u0 org.testmyinv.myinv/org.renpy.android.PythonActivity t224}: app died, no saved state
08-12 21:09:06.675  3669  4113 I WindowManager: Destroying surface Surface(name=org.testmyinv.myinv/org.renpy.android.PythonActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2501 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:985 com.android.server.wm.WindowState.removeImmediately:2404 com.android.server.wm.WindowState.removeIfPossible:2606 com.android.server.wm.WindowState.-wrap1:0 com.android.server.wm.WindowState$DeathRecipient.binderDied:3151 android.os.BinderProxy.sendDeathNotice:841 <bottom of call stack> 
08-12 21:09:06.677  3204  4448 I SurfaceFlinger: id=810 Removed org.testmyinv.myinv/org.renpy.android.PythonActivity#0 (1/4)
08-12 21:09:06.679  3204  4448 I SurfaceFlinger: id=810 Removed org.testmyinv.myinv/org.renpy.android.PythonActivity#0 (-2/4)
08-12 21:09:06.679  3204  3204 I Layer   : id=810 onRemoved org.testmyinv.myinv/org.renpy.android.PythonActivity#0 
08-12 21:09:06.680  3204  3204 I Layer   : id=811 onRemoved SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0 
08-12 21:09:06.680  3204  3204 I Layer   : id=812 onRemoved Background for - SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0 
08-12 21:09:06.829  3669  4113 D PackageManager: getComponentMetadataForIconTray : org.renpy.android.PythonActivity does not exist in mServices
08-12 21:09:06.829  3669  4113 D PackageManager: getComponentMetadataForIconTray : org.renpy.android.PythonActivity does not exist in mProviders
08-12 21:09:06.829  3669  4113 D PackageManager: getComponentMetadataForIconTray : org.renpy.android.PythonActivity does not exist in mReceivers
08-12 21:10:22.935  3669  3669 I ActivityManager: Start proc 11315:org.testmyinv.myinv:python/u0a253 for activity org.testmyinv.myinv/org.renpy.android.PythonActivity
08-12 21:10:22.941 11315 11315 I SELinux : SELinux: seapp_context_lookup: seinfo=untrusted, level=s0:c512,c768, pkgname=org.testmyinv.myinv:python 
08-12 21:10:23.002  3669  5065 I ActivityManager: START u0 {act=android.intent.action.MAIN typ=null flg=0x10200000 cmp=ComponentInfo{org.testmyinv.myinv/org.renpy.android.PythonActivity}} from uid 10080
08-12 21:10:23.049  3669  4415 D ActivityManager: applyOptionsLocked, ANIM_CUSTOM_SCALE_UP, task.getRootActivity() : ActivityRecord{2b8afc7 u0 org.testmyinv.myinv/org.renpy.android.PythonActivity t225}, task.getTaskToReturnTo() : 1
08-12 21:10:23.082  3669  3977 D GameManagerService: handleForegroundChange(). pkgName: org.testmyinv.myinv, clsName: org.renpy.android.PythonActivity,FgActivityName:org.testmyinv.myinv/org.renpy.android.PythonActivity
08-12 21:10:23.231 11315 11315 V python  : metadata fullscreen is0
08-12 21:10:23.235  3669  3808 D MdnieScenarioControlService:  packageName : org.testmyinv.myinv    className : org.renpy.android.PythonActivity
08-12 21:10:23.266 11315 11340 W linker  : /data/app/org.testmyinv.myinv-7WU36wwb1L7FAtlbRgzjFA==/lib/arm/libpython2.7.so: is missing DT_SONAME will use basename as a replacement: "libpython2.7.so"
08-12 21:10:23.271 11315 11340 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_io.so: is missing DT_SONAME will use basename as a replacement: "_io.so"
08-12 21:10:23.273 11315 11340 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/unicodedata.so: is missing DT_SONAME will use basename as a replacement: "unicodedata.so"
08-12 21:10:23.275 11315 11340 I python  : Starting audio thread
08-12 21:10:23.278 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: setView = DecorView@cf96761[PythonActivity] TM=true MM=false
08-12 21:10:23.289 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: dispatchAttachedToWindow
08-12 21:10:23.291  3669  5065 V WindowManager: Relayout Window{58235fd u0 org.testmyinv.myinv/org.renpy.android.PythonActivity}: viewVisibility=0 req=1440x2464 WM.LayoutParams{(0,0)(fillxfill) sim=#123 ty=1 fl=#1810100 wanim=0x10302ea needsMenuKey=2 colorMode=0 naviIconColor=0}
08-12 21:10:23.294  3204  3204 I SurfaceFlinger: id=815 createSurf (1440x2560),1 flag=404, org.testmyinv.myinv/org.renpy.android.PythonActivity#0
08-12 21:10:23.301 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: Relayout returned: old=[0,0][0,0] new=[0,0][1440,2560] result=0x7 surface={valid=true 3720466432} changed=true
08-12 21:10:23.309 11315 11341 D libGLESv1: STS_GLApi : DTS, ODTC are not allowed for Package : org.testmyinv.myinv:python
08-12 21:10:23.315  3204  3204 I SurfaceFlinger: id=816 createSurf (1440x2464),4 flag=404, SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:23.315  3204  3204 I SurfaceFlinger: id=817 createSurf (1440x2464),-1 flag=20404, Background for - SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:23.317 11315 11315 D SurfaceView: BG show() Surface(name=Background for - SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0) org.renpy.android.SDLSurfaceView{5a27b74 V.E...... ......ID 0,0-1440,2464}
08-12 21:10:23.327 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: MSG_RESIZED_REPORT: frame=Rect(0, 0 - 1440, 2560) ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
08-12 21:10:23.327 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: MSG_WINDOW_FOCUS_CHANGED 1
08-12 21:10:23.339  3669 13729 V WindowManager: Relayout Window{58235fd u0 org.testmyinv.myinv/org.renpy.android.PythonActivity}: viewVisibility=0 req=1440x2560 WM.LayoutParams{(0,0)(fillxfill) sim=#23 ty=1 fl=#1810100 fmt=-3 wanim=0x10302ea needsMenuKey=2 colorMode=0 naviIconColor=0}
08-12 21:10:23.340 11315 11357 I python  : presplash-fit is null
08-12 21:10:23.341 11315 11357 I python  : presplash (fit=null) mx=1,406250,my=2,406250
08-12 21:10:23.349 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: Relayout returned: old=[0,0][1440,2560] new=[0,0][1440,2560] result=0x3 surface={valid=true 3720466432} changed=false
08-12 21:10:23.382  3669 13729 V WindowManager: finishDrawingLocked: mDrawState=COMMIT_DRAW_PENDING Window{58235fd u0 org.testmyinv.myinv/org.renpy.android.PythonActivity} in Surface(name=org.testmyinv.myinv/org.renpy.android.PythonActivity)
08-12 21:10:23.395  3669  3697 I ActivityManager: Displayed org.testmyinv.myinv/org.renpy.android.PythonActivity: +336ms
08-12 21:10:23.411 11315 11357 I python  : Initialize Python for Android
08-12 21:10:23.428  3204  3204 D SurfaceFlinger:        HWC | 79ce3f7c00 | 0000 | 0020 | 00 | 0100 | RGBA_8888   |    0.0,    0.0, 1440.0, 2464.0 |    0,   96, 1440, 2560 | SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:23.428  3204  3204 D SurfaceFlinger:        HWC | 79ce3f9100 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1440.0,   96.0 |    0,    0, 1440,   96 | org.testmyinv.myinv/org.renpy.android.PythonActivity#0
08-12 21:10:23.473 11315 11357 I python  : ['/data/user/0/org.testmyinv.myinv/files/lib/python2.7/site-packages', '/data/user/0/org.testmyinv.myinv/files/lib/site-python']
08-12 21:10:23.473 11315 11357 I python  : Android path ['/data/user/0/org.testmyinv.myinv/files/lib/python27.zip', '/data/user/0/org.testmyinv.myinv/files/lib/python2.7', '/data/user/0/org.testmyinv.myinv/files/lib/python2.7/lib-dynload', '/data/user/0/org.testmyinv.myinv/files/lib/python2.7/site-packages', '/data/user/0/org.testmyinv.myinv/files', '/data/user/0/org.testmyinv.myinv/files/_applibs']
08-12 21:10:23.473 11315 11357 I python  : Android kivy bootstrap done. __name__ is __main__
08-12 21:10:23.473 11315 11357 I python  : Run user program, change dir and execute main.py
08-12 21:10:23.498 11315 11357 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_hashlib.so: is missing DT_SONAME will use basename as a replacement: "_hashlib.so"
08-12 21:10:23.542  3669  3808 D MdnieScenarioControlService:  packageName : org.testmyinv.myinv    className : org.renpy.android.PythonActivity
08-12 21:10:23.571  3204  3204 D SurfaceFlinger:        HWC | 79ce3f7c00 | 0000 | 0020 | 00 | 0100 | RGBA_8888   |    0.0,    0.0, 1440.0, 2464.0 |    0,   96, 1440, 2560 | SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:23.571  3204  3204 D SurfaceFlinger:        HWC | 79ce3f9100 | 0000 | 0000 | 00 | 0105 | RGBA_8888   |    0.0,    0.0, 1440.0,   96.0 |    0,    0, 1440,   96 | org.testmyinv.myinv/org.renpy.android.PythonActivity#0
08-12 21:10:23.583 11315 11357 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.testmyinv.myinv/files/.kivy/logs/kivy_18-08-12_5.txt
08-12 21:10:23.583 11315 11357 I python  : [INFO   ] [Kivy        ] v1.10.1
08-12 21:10:23.584 11315 11357 I python  : [INFO   ] [Python      ] v2.7.2 (default, Aug 12 2018, 13:35:04) 
08-12 21:10:23.584 11315 11357 I python  : [GCC 4.8]
08-12 21:10:23.593 11315 11357 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_ctypes.so: is missing DT_SONAME will use basename as a replacement: "_ctypes.so"
08-12 21:10:23.608 11315 11357 I python  : [INFO   ] [Factory     ] 194 symbols loaded
08-12 21:10:24.058 11315 11357 I python  :  /data/user/0/org.testmyinv.myinv/files/lib/python2.7/site-packages/kivy/core/image/img_pygame.py:12: RuntimeWarning: import cdrom: No module named cdrom
08-12 21:10:24.058 11315 11357 I python  :  (ImportError: No module named cdrom)
08-12 21:10:24.068 11315 11357 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_pygame, img_gif (img_pil, img_ffpyplayer ignored)
08-12 21:10:24.080 11315 11357 W linker  : /data/data/org.testmyinv.myinv/files/lib/python2.7/lib-dynload/_ssl.so: is missing DT_SONAME will use basename as a replacement: "_ssl.so"
08-12 21:10:24.100 11315 11357 I python  : [INFO   ] [Text        ] Provider: pygame
08-12 21:10:24.509 11315 11357 I python  : [INFO   ] [Window      ] Provider: pygame
08-12 21:10:24.513 11315 11357 I python  : [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
08-12 21:10:24.514 11315 11357 I python  : [INFO   ] [GL          ] Backend used <gl>
08-12 21:10:24.515 11315 11357 I python  : [INFO   ] [GL          ] OpenGL version <OpenGL ES 3.2 v1.r22p0-01rel0.f294e54ceb2cb2d81039204fa4b0402e>
08-12 21:10:24.515 11315 11357 I python  : [INFO   ] [GL          ] OpenGL vendor <ARM>
08-12 21:10:24.515 11315 11357 I python  : [INFO   ] [GL          ] OpenGL renderer <Mali-T880>
08-12 21:10:24.515 11315 11357 I python  : [INFO   ] [GL          ] OpenGL parsed version: 3, 2
08-12 21:10:24.516 11315 11357 I python  : [INFO   ] [GL          ] Texture max size <8192>
08-12 21:10:24.516 11315 11357 I python  : [INFO   ] [GL          ] Texture max units <16>
08-12 21:10:24.518 11315 11357 D libGLESv2: STS_GLApi : DTS, ODTC are not allowed for Package : org.testmyinv.myinv:python
08-12 21:10:24.522 11315 11357 I python  : [INFO   ] [Support     ] Android install hooks
08-12 21:10:24.523 11315 11357 I python  : [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
08-12 21:10:24.748 11315 11357 I python  : [WARNING] [Lang        ] The file /data/data/org.testmyinv.myinv/files/main.kv is loaded multiples times, you might have unwanted behaviors.
08-12 21:10:24.764 11315 11357 I python  : [WARNING] [Factory     ] Ignored class "MultiSelectOption" re-declaration. Current -  module: None, cls: None, baseclass: ToggleButton, filename: /data/data/org.testmyinv.myinv/files/main.kv. Ignored -  module: None, cls: None, baseclass: ToggleButton, filename: /data/data/org.testmyinv.myinv/files/main.kv.
08-12 21:10:24.829 11315 11357 I python  : [INFO   ] [Base        ] Start application main loop
08-12 21:10:24.829 11315 11357 I python  : [INFO   ] [Android     ] found 17 joystick
08-12 21:10:24.830 11315 11357 I python  : [INFO   ] [Android     ] create joystick <0>
08-12 21:10:24.830 11315 11357 I python  : [INFO   ] [Android     ] discard joystick <0> cause no button
08-12 21:10:24.830 11315 11357 I python  : [INFO   ] [Android     ] create joystick <1>
08-12 21:10:24.831 11315 11357 I python  : [INFO   ] [Android     ] create joystick <2>
08-12 21:10:24.831 11315 11357 I python  : [INFO   ] [Android     ] create joystick <3>
08-12 21:10:24.831 11315 11357 I python  : [INFO   ] [Android     ] create joystick <4>
08-12 21:10:24.831 11315 11357 I python  : [INFO   ] [Android     ] create joystick <5>
08-12 21:10:24.832 11315 11357 I python  : [INFO   ] [Android     ] create joystick <6>
08-12 21:10:24.832 11315 11357 I python  : [INFO   ] [Android     ] create joystick <7>
08-12 21:10:24.832 11315 11357 I python  : [INFO   ] [Android     ] create joystick <8>
08-12 21:10:24.832 11315 11357 I python  : [INFO   ] [Android     ] create joystick <9>
08-12 21:10:24.833 11315 11357 I python  : [INFO   ] [Android     ] create joystick <10>
08-12 21:10:24.833 11315 11357 I python  : [INFO   ] [Android     ] create joystick <11>
08-12 21:10:24.833 11315 11357 I python  : [INFO   ] [Android     ] create joystick <12>
08-12 21:10:24.833 11315 11357 I python  : [INFO   ] [Android     ] create joystick <13>
08-12 21:10:24.834 11315 11357 I python  : [INFO   ] [Android     ] create joystick <14>
08-12 21:10:24.834 11315 11357 I python  : [INFO   ] [Android     ] create joystick <15>
08-12 21:10:24.834 11315 11357 I python  : [INFO   ] [Android     ] create joystick <16>
08-12 21:10:25.212 11315 11357 I python  : [INFO   ] [GL          ] NPOT texture support is available
08-12 21:10:25.236 11315 11357 I python  : [WARNING] [Base        ] Failed to import "android" module. Could not remove android presplash.
08-12 21:10:26.143 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 0
08-12 21:10:26.223 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 1
08-12 21:10:27.081 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 0
08-12 21:10:27.163 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 1
08-12 21:10:27.363  3204  3204 D SurfaceFlinger:        HWC | 79ce3f7c00 | 0000 | 0020 | 00 | 0100 | RGBA_8888   |    0.0,    0.0, 1440.0, 2464.0 |    0,   96, 1440, 2560 | SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:27.457 11315 11315 D Python: : TextAfterCursor 
08-12 21:10:27.470 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1440, 2560) ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 1164) or=1
08-12 21:10:27.478 11315 11315 I Python: : Layout Triggered, Keyboard_height: 1164
08-12 21:10:27.511  3204  3204 D SurfaceFlinger:        HWC | 79ce3f7c00 | 0000 | 0020 | 00 | 0100 | RGBA_8888   |    0.0,    0.0, 1440.0, 2464.0 |    0,   96, 1440, 2560 | SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:27.974 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme key 0
08-12 21:10:27.975 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme key 1
08-12 21:10:28.199 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme key 0
08-12 21:10:28.200 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme key 1
08-12 21:10:28.384 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme key 0
08-12 21:10:28.386 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme key 1
08-12 21:10:28.681 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 0
08-12 21:10:28.746 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 1
08-12 21:10:28.804 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: MSG_RESIZED: frame=Rect(0, 0 - 1440, 2560) ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
08-12 21:10:28.823 11315 11315 I Python: : Layout Triggered, Keyboard_height: 0
08-12 21:10:28.999  3204  3204 D SurfaceFlinger:        HWC | 79d254ac00 | 0000 | 0020 | 00 | 0100 | RGBA_8888   |    0.0,    0.0, 1440.0, 2464.0 |    0,   96, 1440, 2560 | SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0
08-12 21:10:29.334 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 0
08-12 21:10:29.350 11315 11357 I python  : (u'', u'ggf')
08-12 21:10:29.350 11315 11357 I python  : http-start
08-12 21:10:29.357 11315 11357 I python  : [INFO   ] [Base        ] Leaving application in progress...
08-12 21:10:29.358 11315 11357 I python  :  Traceback (most recent call last):
08-12 21:10:29.358 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/app/main.py", line 184, in <module>
08-12 21:10:29.359 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/app.py", line 826, in run
08-12 21:10:29.360 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 502, in runTouchApp
08-12 21:10:29.361 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 403, in mainloop
08-12 21:10:29.362 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/window_pygame.py", line 289, in _mainloop
08-12 21:10:29.362 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 340, in idle
08-12 21:10:29.363 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 325, in dispatch_input
08-12 21:10:29.364 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/base.py", line 231, in post_dispatch_input
08-12 21:10:29.364 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.365 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/__init__.py", line 1360, in on_motion
08-12 21:10:29.366 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.367 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/core/window/__init__.py", line 1376, in on_touch_down
08-12 21:10:29.367 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.368 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/screenmanager.py", line 1191, in on_touch_down
08-12 21:10:29.369 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:10:29.370 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.370 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/relativelayout.py", line 288, in on_touch_down
08-12 21:10:29.371 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:10:29.372 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.373 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:10:29.373 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.374 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/widget.py", line 460, in on_touch_down
08-12 21:10:29.375 11315 11357 I python  :    File "kivy/_event.pyx", line 707, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8192)
08-12 21:10:29.375 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/uix/behaviors/button.py", line 151, in on_touch_down
08-12 21:10:29.376 11315 11357 I python  :    File "kivy/_event.pyx", line 703, in kivy._event.EventDispatcher.dispatch (kivy/_event.c:8147)
08-12 21:10:29.377 11315 11357 I python  :    File "kivy/_event.pyx", line 1214, in kivy._event.EventObservers.dispatch (kivy/_event.c:14036)
08-12 21:10:29.378 11315 11357 I python  :    File "kivy/_event.pyx", line 1098, in kivy._event.EventObservers._dispatch (kivy/_event.c:12817)
08-12 21:10:29.379 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/platform/python-for-android/build/python-install/lib/python2.7/site-packages/kivy/lang/builder.py", line 64, in custom_callback
08-12 21:10:29.380 11315 11357 I python  :    File "/data/data/org.testmyinv.myinv/files/main.kv", line 93, in <module>
08-12 21:10:29.380 11315 11357 I python  :      on_press: root.http_request_myinv(login.text,password.text)
08-12 21:10:29.381 11315 11357 I python  :    File "/home/kivy/Desktop/build/android/app/main.py", line 79, in http_request_myinv
08-12 21:10:29.382 11315 11357 I python  :  AttributeError: 'module' object has no attribute 'parse'
08-12 21:10:29.408 11315 11315 D ViewRootImpl@fdc7ac8[PythonActivity]: ViewPostIme pointer 1
08-12 21:10:29.470 11315 11357 I python  : Python for android ended.
08-12 21:10:29.592  3204  3204 I SurfaceFlinger: id=816 Removed SurfaceView - org.testmyinv.myinv/org.renpy.android.PythonActivity@5a27b74@0#0 (1/5)
08-12 21:10:29.592  3204  3204 I SurfaceFlinger: id=817 Removed Background for - SurfaceView - org.testmyinv.myinv/org.renpy
AndreMiras commented 6 years ago

You probably need to import urllib.parse in a that more explicit fashion. Now that you have the log it should be fairly easy to debug.

Mark-Wellings commented 6 years ago

Jeah, just realized that. It's added to the main.py now and compiling pray

Mark-Wellings commented 6 years ago

Now when I open the app it crashes. This is home my import looks:

from kivy.app import App
#kivy.require("1.9.1")
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import ObjectProperty
from kivy.network.urlrequest import UrlRequest
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
from kivy.properties import StringProperty
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
from kivy.uix.scrollview import ScrollView
from kivy.factory import Factory
from kivy.properties import ListProperty, ObjectProperty
from kivy.uix.dropdown import DropDown
from kivy.uix.button import Button
import urllib
import urllib.parse  

And here the logcat. Do I have to adjust the spec file? https://github.com/Mark-Wellings/kivy_myinv_url/blob/master/adb_logcat_git.txt

AndreMiras commented 6 years ago

Yes totally you need to fix your software to work for Python2. See urlparse documentation https://docs.python.org/2/library/urlparse.html

Note The urlparse module is renamed to urllib.parse in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

So basically what happens probably is your software runs fine on host because you're running on Python3 on your host. I would recommend to create the same environment for testing, e.g. using a virtualenv.

cd /tmp/trash/
[andre:/tmp/trash] $ virtualenv --python=python2.7 venv
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /tmp/trash/venv/bin/python2.7
Also creating executable in /tmp/trash/venv/bin/python
Installing setuptools, pip, wheel...done.
[andre:/tmp/trash] 3s $ . venv/bin/activate
[andre:/tmp/trash] [venv] $ python -c "import urllib.parse"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named parse
[andre:/tmp/trash] [venv] 1 $

But that's not really a p4a issue :confused:

Mark-Wellings commented 6 years ago

Sorry, I am a bit lost.. on my local machine I run the app with Python 2.7 No idea what to do from here.. gracias por la ayuda :-)

AndreMiras commented 6 years ago

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 pip freeze. Both commands on your host.

subbNine commented 6 years ago

For python 3 You should do: from urllib.parse import urlencode

For python 2 you should do: from urllib import urlencode

subbNine commented 6 years ago

To accommodate both python 2 and 3:

try: from urllib.parse import urlencode except ImportError, AttributeError: from urllib import urlencode

Mark-Wellings commented 6 years ago

Thanks very much. Which req would I have to put in the spec file?

subbNine commented 6 years ago

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.

Mark-Wellings commented 6 years ago

Perfect, thanks! Ok, so finally I've managed to have it run on Python 2.7 PyCharm was driving me crazy, so I'm back using the Python IDLE. Will try to compile tomorrow and let you know. The requirements = kivy, hostpython2 are fine?

Mark-Wellings commented 6 years ago

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

AndreMiras commented 6 years ago

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.

Mark-Wellings commented 6 years ago

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 :-)

AndreMiras commented 6 years ago

Yes I would recommend to go full Python 3.6 indeed. However you may need to create a custom recipe for SSL support. See pull request https://github.com/kivy/python-for-android/pull/1217 and custom python3crystax recipe example. Good luck :four_leaf_clover: