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

Can't build in Simulator on m1? Need arm64 architecture #1933

Open
bryan1anderson opened this issue Sep 26, 2022 · 2 comments
Open

Can't build in Simulator on m1? Need arm64 architecture #1933

bryan1anderson opened this issue Sep 26, 2022 · 2 comments

Comments

@bryan1anderson
Copy link

Is there a way to build this out for simulator on m1? I can't figure out how to get the correct slice for simulator arm 64 architecture for our XCFramework

@ferencIOS
Copy link

ferencIOS commented Dec 6, 2022

@bryan1anderson

I solved this way:

STEP 1 (j2objc proj)

git clone https://github.com/google/j2objc.git
cd j2objc
git checkout 4adbb2ddc7c542431902ee14e77256ba7808923d

STEP 2 (java)
Then from Oracle took the jdk-11.0.17_macos-aarch64_bin.dmg, install it!

Open your bash/zsh file and put

export JAVA_HOME=`/usr/libexec/java_home -v 11`

(you can check also here: Installation of the JDK on macOS)

STEP 3 (protobuf)
Update the command line and install protobuf as the j2objc guide show

STEP 4 (xcframeworks)
Run

make dist

you will find this path dist/frameworks

STEP 5 (optional)
In case of error run:

make clean

and then retry STEP 4

I did it on my m1 macOS 13.0.1 (22A400)

@waelsaad
Copy link

waelsaad commented Apr 28, 2024

Hi, I have a Macbook Pro M3 Max and with v2.8 when I try to run an example project I keep getting:-

Building for 'iOS-simulator', but linking in object file (/Frameworks/j2objc/j2objc/lib/libjre_emul.a[arm64][2](ErrnoException.o)) built for 'iOS'

I am trying to compile j2objc I followed all steps. For me before make dist I had to do brew install mavenperhaps the steps above needs to be updated. After compiling for a while it built j2objc and j2objcc and some frameworks and libs but not everything as I ran into the following:-

FYI, As mentioned above I did git checkout 4adbb2d

compiling /Frameworks/j2objc/j2objc-3.0.0/j2objc/guava/build_result/objc/com/google/common/collect/GeneralRange.m /Frameworks/j2objc/j2objc-3.0.0/j2objc/guava/build_result/objc/com/google/common/collect/GeneralRange.m:381:66: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] ComGoogleCommonBasePreconditions_checkArgumentWithBoolean_((lowerBoundType != JreLoadEnum(ComGoogleCommonCollectBoundType, OPEN)) | (upperBoundType != JreLoadEnum(ComGoogleCommonCollectBoundType, OPEN))); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ || /Frameworks/j2objc/j2objc-3.0.0/j2objc/guava/build_result/objc/com/google/common/collect/GeneralRange.m:381:66: note: cast one or both operands to int to silence this warning 1 error generated. make[2]: *** [/Frameworks/j2objc/j2objc-3.0.0/j2objc/guava/build_result/objs-iphone64/com/google/common/collect/GeneralRange.o] Error 1 make[1]: *** [framework_jre] Error 2 make: *** [guava_dist] Error 2
cc @tomball

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants