Skip to content

[Temporary Resolved] Python 4 android in mac os with Apple Silicon via Roseta #2528

Closed

Description

@jhay06

Hi ,
Any one here managed to build apk successfully on mac device with Apple silicon cpu via Rosetta?

I did all i can but building in P4a or buildozer has the same error ,

it always fails on import binascii, symbol not found _crc32

Device: Macbook Air
OS: Big Sur

Please see attached image
Snip20211206_1

Activity

  1. misl6 commented on Dec 8, 2021

    @misl6
    Member

    @jhay06 in your requirements can you try to force hostpython3==3.9.9, python3==3.9.9 ?

  2. self-assigned this
    on Dec 8, 2021
  3. jhay06 commented on Dec 8, 2021

    @jhay06
    Author

    @jhay06 in your requirements can you try to force hostpython3==3.9.9, python3==3.9.9 ?

    thanks for the response ,
    By the way i have another issue , i have to blacklist libffi because there's an issue on its automake version , i have automake 1.6.5 but libffi failed to compile because it was created using automake 1.6.3
    image

    so i have to run this p4a command and do your suggested resolution
    p4a apk --requirements=python3==3.9.9,hostpython3==3.9.9,kivy --bootstrap=sdl2 --sdk_dir ~/.buildozer/android/platform/android-sdk --android_api 27 --ndk_dir ~/.buildozer/android/platform/android-ndk-r19c --private . --name 'myapp' --package org.sample.app --version 0.1 --dist_name 'testapp' --blacklist-requirements=libffi

    but has the same error , please see below

    image

  4. jhay06 commented on Dec 13, 2021

    @jhay06
    Author

    Okay i think i know the issue here, it is how hostpython3 built in macos ,using the p4a . when p4a run the hostpython3 building , the build architecture of hostpython3 is for linux that's why library files shown on the images above are in .so file which is standard library of a linux , this will not work on mac os device, because mac os uses dylib file not .so file,

    so i have to create a temporary resolution for this ,

    i have to go to /Users/cebx/.pyton-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build and remove python.exe , python3 files as well as Python folder and build folder there , then create a link of python and python3 from my python virtualenv folder , python = python.exe and python3 = python3 then re run the p4a, and it works

    this is just a temporary solution i made , hope that this will fix on the next update of the python-for-android

    ,

    also to resolve the libfi i have to remove automake , autoconf , libtool , pkgconfig that was installed using homebrew and replace it using macports ,

  5. changed the title [-]Python 4 android in mac os with Apple Silicon via Roseta[/-] [+][Temporary Resolved] Python 4 android in mac os with Apple Silicon via Roseta[/+] on Dec 13, 2021
  6. jhay06 commented on Dec 30, 2021

    @jhay06
    Author

    would like to ask if i can join as contributor to this project , will try to contribute maybe i can create a permanent fix for this issue.

  7. misl6 commented on Jul 14, 2022

    @misl6
    Member

    Fixed via #2586, feel free to re-open the issue if you're still encountering it on the develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions