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

'Orientation' and 'Fullscreen' settings in spec file: Possible issue. #1655

Closed excepterror closed 5 years ago

excepterror commented 5 years ago

Versions

Description

Hello. Lately, I have been working with Pyjnius. For testing purposes I created an app. Orientation was set to 'portrait' and full-screen to '0', however, the app opens in landscape mode and runs in full screen. I believe I am not the first who came across this. Please, have a look at the 6th post, here: https://groups.google.com/forum/#!topic/kivy-users/e9hsuojM_iM

Attached you may find the main.py file. main.txt

buildozer.spec

Command:

buildozer android debug

Spec file:

[app]

# (str) Title of your application
title = PJN

# (str) Package name
package.name = pjnapp

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

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

# (str) Application versioning (method 2)
# version.regex = __version__ = ['"](.*)['"]
# version.filename = %(source.dir)s/main.py

# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python2,kivy

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

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

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

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

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

# (list) Java classes to add as activities to the manifest.
#android.add_activites = com.example.ExampleActivity

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

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

# (str) launchMode to set for the main activity
#android.manifest.launch_mode = standard

# (list) Android additional 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

# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask)
#p4a.port =

#
# 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 = ./.buildozer

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

Logs

[INFO]:    Dist can be found at (for now) /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp
# Build the application #1                                                                                                                   
# Copy application source from /home/thomas/PJN
# Create directory /home/thomas/PJN/.buildozer/android/app
# Copy /home/thomas/PJN/main.py
# Package the application
# project.properties updated
# Gradle project detected, copy files /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/src/main/java
# Run '/usr/bin/python -m pythonforandroid.toolchain apk --debug --bootstrap=sdl2 --dist_name pjnapp --name PJN --version 0.0.5 --package org.pjn.pjnapp --android_api 28 --minsdk 21 --private /home/thomas/PJN/.buildozer/android/app --permission INTERNET --permission ACCESS_NETWORK_STATE --orientation portrait --window --copy-libs --arch armeabi-v7a --color=always --storage-dir="/home/thomas/PJN/.buildozer/android/platform/build"'
# Cwd /home/thomas/PJN/.buildozer/android/platform/python-for-android-new-toolchain
[WARNING]: $ANDROIDNDKVER is deprecated and no longer necessary, the value you set is ignored
[INFO]:    Will compile for the following archs: armeabi-v7a
[INFO]:    Getting Android API version from user argument: 28
[INFO]:    Available Android APIs are (28)
[INFO]:    Requested API target 28 is available, continuing.
[INFO]:    Found NDK dir in $ANDROIDNDK: /home/thomas/.buildozer/android/platform/android-ndk-r17c
[INFO]:    Found NDK revision 17.2.4988734
[WARNING]: NDK API target was not set manually, using the default of 21 = min(android-api=28, default ndk-api=21)
[INFO]:    Found virtualenv at /home/thomas/.local/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9']
[INFO]:    Picking the latest gcc toolchain, here 4.9
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:     pjnapp: min API 21, includes recipes (hostpython2, sdl2_image, sdl2_mixer, sdl2_ttf, python2, sdl2, six, pyjnius, kivy), built for archs (armeabi-v7a)
[INFO]:    pjnapp has compatible recipes, using this one
[INFO]:    Of the existing distributions, the following meet the given requirements:
[INFO]:     pjnapp: min API 21, includes recipes (hostpython2, sdl2_image, sdl2_mixer, sdl2_ttf, python2, sdl2, six, pyjnius, kivy), built for archs (armeabi-v7a)
[INFO]:    pjnapp has compatible recipes, using this one
[INFO]:    -> directory context /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp
Listing /tmp/p4a-extra-env-yr4Gpx ...
Listing /home/thomas/PJN/.buildozer/android/app ...
Listing /home/thomas/PJN/.buildozer/android/app/_applibs ...
Compiling /home/thomas/PJN/.buildozer/android/app/main.py ...
Compiling /home/thomas/PJN/.buildozer/android/app/sitecustomize.py ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/modules ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/jnius ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/jnius/src ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/jnius/src/org ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/jnius/src/org/jnius ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/adapters ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/audio ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/camera ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/clipboard ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/gl ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/image ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/spelling ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/text ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/video ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/core/window ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/data ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/data/fonts ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/data/glsl ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/data/images ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/data/keyboards ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/data/logo ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/deps ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/effects ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/extras ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/garden ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/graphics ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/graphics/cgl_backend ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/include ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/input ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/input/postproc ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/input/providers ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/lang ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/lib ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/lib/gstplayer ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/lib/osc ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/lib/vidcore_lite ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/modules ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/network ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/storage ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/gles_compat ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/highlight ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/packaging ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/packaging/pyinstaller_hooks ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/pep8checker ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/theming ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/tools/theming/defaulttheme ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/uix ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/uix/behaviors ...
Listing /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/_python_bundle/_python_bundle/site-packages/kivy/uix/recycleview ...
[INFO]:    Selecting java build tool:
[INFO]:    Detected highest available build tools version to be 28.0.3
[INFO]:        Building with gradle, as gradle executable is present
[DEBUG]:   -> running gradlew assembleDebug
[DEBUG]:    Starting a Gradle Daemon (subsequent builds will be faster)
[DEBUG]:    
[DEBUG]:    > Task :compileDebugJavaWithJavac 
[DEBUG]:    Note: Some input files use or override a deprecated API.
[DEBUG]:    Note: Recompile with -Xlint:deprecation for details.
[DEBUG]:    Note: Some input files use unchecked or unsafe operations.
[DEBUG]:    Note: Recompile with -Xlint:unchecked for details.
[DEBUG]:    
[DEBUG]:    
[DEBUG]:    BUILD SUCCESSFUL in 27s
[DEBUG]:    27 actionable tasks: 27 executed

[INFO]:    <- directory context /home/thomas/PJN/.buildozer/android/platform/python-for-android-new-toolchain
[INFO]:    # Copying APK to current directory
[INFO]:    # APK filename not found in build output. Guessing...
[INFO]:    # Found APK file: /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/build/outputs/apk/debug/pjnapp-debug.apk
[INFO]:    # Add version number to APK
[INFO]:    # APK renamed to pjnapp-0.0.5-debug.apk
[DEBUG]:   -> running cp /home/thomas/PJN/.buildozer/android/platform/build/dists/pjnapp/build/outputs/apk/debug/pjnapp-debug.apk pjnapp-0.0.5-debug.apk
WARNING: Received a --sdk argument, but this argument is deprecated and does nothing.
No compiled python is present to zip, skipping.
Applying Java source code patches...
Applying patch: src/patches/SDLActivity.java.patch
# Android packaging done!
# APK pjnapp-0.0.5-debug.apk available in the bin directory
inclement commented 5 years ago

Are you using Kivy's master branch? In your buildozer.spec you are not, you can do that by writing kivy==master.

excepterror commented 5 years ago

You are correct, I don't. However, the apk won't run because I get this error: descriptor 'property' requires a kivy.event object but received a 'method_descriptor' therefore I cannot verify if setting kivy to master branch fixes the issue. You are probably right, though. Does this mean that one should build his project using kivy's master branch? Moreover, should one install kivy's dev version and work with that instead of using stable 1.10.1? I hope not.

inclement commented 5 years ago

Yes, currently to use python-for-android master you should also use kivy master.

excepterror commented 5 years ago

Right, thanks for the answers! I am closing this one.

ivanadam commented 5 years ago

I’m having the same problem where I set orientation to portrait but it builds the app in landscape anyway. I tried adding kivy==master to spec file, but that did not work for me.

AndreMiras commented 5 years ago

Thanks guys for reporting! Yes I also add this issue and for me running kivy on master totally helped. However I had to totally clean my builds and somehow cleaning it with buildozer commands wasn't enough. So well rm -rf <project_dir>/.buildozer/

ivanadam commented 5 years ago

I tried doing a clean build with kivy master, but now when I start the app it crashes due to Unable to find any valuable Window provider error.

OptimusGREEN commented 5 years ago

python I [CRITICAL] [Window ] Unable to find any valuable Window provider.

me too with master https://paste.city/139

ivanadam commented 5 years ago

Can somebody fix this issue?

inclement commented 5 years ago

@ivanadam Please open a new issue including the adb logcat output.

@opacam Although there look to be gl errors, I don't understand why you end up with a traceback pointing to an unrelated python library. What happens if you run a trivial app, e.g. just a Label?

opacam commented 5 years ago

:eyes: @inclement... I don't know what are you talking about... Maybe, do you wanted to say @OptimusGREEN?

inclement commented 5 years ago

@opacam Ah, yes, sorry about that.

opacam commented 5 years ago

No problem :wink:

OptimusGREEN commented 5 years ago

@inclement I'll give it a go, however the label would have to be getting info from Kivy.core.Window which is what's happening in my app. Also if I revert to 1.10.1 then the error goes away.

Also, worth noting that I'm currently building on linux which I'm not used to due to the current MacOS issue with p4a, so unable to test in my usual environment.

AndreMiras commented 5 years ago

Wait @OptimusGREEN the runtime issue you shared has nothing to do with p4a to me:

D  Relayout returned: old=[0,0][1080,2076] new=[0,0][1080,2076] result=0x1 surface={valid=true 3744763904} changed=false
                 python  I  [CRITICAL] [Window      ] Unable to find any valuable Window provider.
                         I  sdl2 - Exception: Unknown <png> type, no loader found.
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/__init__.
                            py", line 67, in core_select_lib
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/window/wi
                            ndow_sdl2.py", line 140, in __init__
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/window/__
                            init__.py", line 968, in __init__
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/window/wi
                            ndow_sdl2.py", line 293, in create_window
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/window/__
                            init__.py", line 1216, in create_window
                         I    File "kivy/graphics/instructions.pyx", line 783, in kivy.graphics.instructions.RenderContext.__init__
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/image/__i
                            nit__.py", line 561, in __init__
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/image/__i
                            nit__.py", line 757, in _set_filename
                         I    File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/platform/build/build/python-installs/optileave.premium/kivy/core/image/__i
                            nit__.py", line 463, in load
                         I  [INFO   ] [MD          ] forked KivyMD version: 0.1.2
                         I  [INFO   ] [Text        ] Provider: sdl2
                         I   Traceback (most recent call last):
                         I     File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/app/main.py", line 23, in <module>
                         I     File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/app/libs/md/theming.py", line 14, in <module>
                         I     File "/home/kivy/Development/git/ogleavetracker/optileave/.buildozer/android/app/libs/md/material_resources.py", line 11, in <module>
                         I   AttributeError: 'NoneType' object has no attribute 'width'
                         I  Python for android ended.

This is clearly an issue with KivyMD. Try a more recent version or another fork. Also you would have better luck on Discord support channel

OptimusGREEN commented 5 years ago

sorry, I didn't explain it properly. This issue has nothing to do with p4a, the ongoing issue I was referring to was https://github.com/kivy/python-for-android/issues/1647 .

That is why I'm currently using linux.

OptimusGREEN commented 5 years ago

Ok, I just changed kivy==master back to kivy==1.10.1 and the error is gone, I obviously am stuck in landscape but the error only happens with master on android.

its my fork of md I'm using and all the code is doing is asking for the Window.width. Its almost like the the window creation is delayed in master hence the None type object.