Skip to content
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

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

Closed
jhay06 opened this issue Dec 6, 2021 · 5 comments
Closed
Assignees

Comments

@jhay06
Copy link

jhay06 commented Dec 6, 2021

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

@misl6
Copy link
Member

misl6 commented Dec 8, 2021

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

@misl6 misl6 self-assigned this Dec 8, 2021
@jhay06
Copy link
Author

jhay06 commented Dec 8, 2021

@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

@jhay06
Copy link
Author

jhay06 commented Dec 13, 2021

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 ,

@jhay06 jhay06 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 Dec 13, 2021
@jhay06
Copy link
Author

jhay06 commented Dec 30, 2021

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.

@misl6
Copy link
Member

misl6 commented Jul 14, 2022

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

@misl6 misl6 closed this as completed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants