Python 3.3.2+ on android

前端 未结 2 1784
夕颜
夕颜 2020-12-17 03:15

I have been trying to build Python 3.3.2 for android but I have run into a dead end. I might be doing something wrong.

Here is my buildscript:

# Unpa         


        
相关标签:
2条回答
  • 2020-12-17 03:22

    FWIW I was able to get Python 3.5 on android via kivy/buildozer + crystax (place crystax in ~/.buildozer/crystax-ndk-10.3.2)

    Install Android Studio so you have adb at the command line.

    Python 3.5 in Ubuntu 18.04

    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt-get update
    sudo apt install python3.5
    

    Get the latest and greatest buildozer (required for python3 in Fall 2018)

    sudo -H pip install git+https://github.com/kivy/buildozer
    

    Make a little testbed

    mkdir py3android
    cd py3android
    mkdir src
    

    src/main.py

    from kivy.app import App
    from kivy.uix.button import Button
    
    class TestApp(App):
        def build(self):
            return Button(text='Hello World')
    
    TestApp().run()
    

    buildozer.spec (Run buildozer init to create a skeleton first)

    [app]
    title = My App
    package.name = myapp
    package.domain = com.mycompany
    source.dir = ./src
    source.include_exts = py,png,jpg
    source.include_patterns = img/
    version = 0.1
    requirements = python3crystax,kivy,git+git://github.com/wolfgangp/python-for-android
    orientation = portrait
    osx.python_version = 3
    osx.kivy_version = 1.9.1
    fullscreen = 0
    android.ndk = 10.3.2
    android.ndk_path = ~/.buildozer/crystax-ndk-10.3.2
    android.entrypoint = org.renpy.android.PythonActivity
    
    
    [buildozer]
    log_level = 2
    warn_on_root = 1
    

    The git library wolfgangp/python-for-android will be removed once this pull request is accepted, then it can be changed to android==master

    Then cd py3android, plug in your physical android device via USB (you can use emulators too btw) and simply run buildozer android debug run logcat | grep -C 50 Traceback to see your app and print any tracebacks to the log.

    0 讨论(0)
  • 2020-12-17 03:40

    You could report this in the issue traker of python http://bugs.python.org/

    0 讨论(0)
提交回复
热议问题