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

[Compile]: How to compile IOS version #516

Closed
zhaolibo1989 opened this issue Feb 22, 2024 · 4 comments
Closed

[Compile]: How to compile IOS version #516

zhaolibo1989 opened this issue Feb 22, 2024 · 4 comments
Labels
needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@zhaolibo1989
Copy link
Contributor

zhaolibo1989 commented Feb 22, 2024

What would you like to share?

I am trying to compile Android, WASM, and IOS versions on the Windows platform.

I have successfully compiled Android and WASM versions using the following scripts.

Android:

go get golang.org/x/mobile/bind
go env -w GOOS=windows GOARCH=amd64
set JAVA_TOOL_OPTIONS=-Dfile.encoding=utf-8 
gomobile bind -v -trimpath -ldflags="-s -w" -o ./open_im_sdk.aar -target=android ./open_im_sdk/ ./open_im_sdk_callback/

WASM:

go env -w GOOS=js GOARCH=wasm 
go build -trimpath -ldflags "-s -w" -o ./_output/bin/openIM.wasm wasm/cmd/main.go

However, using similar scripts cannot compile the IOS version.

IOS:

go get golang.org/x/mobile/bind

RMDIR /Q build
RMDIR /Q open_im_sdk\ws_wrapper
DEL /Q open_im_sdk\t_friend_sdk.go
DEL /Q open_im_sdk\t_group_sdk.go

go env -w GOOS=darwin GOARCH=arm64
gomobile bind -v -trimpath -ldflags "-s -w" -o build/OpenIMCore.xcframework -target=ios ./open_im_sdk/ ./open_im_sdk_callback/

How can I complie the IOS version?

Additional information

My IOS build script output:

D:\work\code\OpenIMSDK\openim-sdk-core>go get golang.org/x/mobile/bind

D:\work\code\OpenIMSDK\openim-sdk-core>RMDIR /Q build
系统找不到指定的文件。

D:\work\code\OpenIMSDK\openim-sdk-core>RMDIR /Q open_im_sdk\ws_wrapper
系统找不到指定的文件。

D:\work\code\OpenIMSDK\openim-sdk-core>DEL /Q open_im_sdk\t_friend_sdk.go
找不到 D:\work\code\OpenIMSDK\openim-sdk-core\open_im_sdk\t_friend_sdk.go

D:\work\code\OpenIMSDK\openim-sdk-core>DEL /Q open_im_sdk\t_group_sdk.go
找不到 D:\work\code\OpenIMSDK\openim-sdk-core\open_im_sdk\t_group_sdk.go

D:\work\code\OpenIMSDK\openim-sdk-core>go env -w GOOS=darwin GOARCH=arm64

D:\work\code\OpenIMSDK\openim-sdk-core>gomobile bind -v -trimpath -ldflags "-s -w" -o build/OpenIMCore.xcframework -target=ios ./open_im_sdk/ ./open_im_sdk_callback/
gomobile: -target="ios" requires Xcode
@zhaolibo1989 zhaolibo1989 added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Feb 22, 2024
@FGadvancer
Copy link
Member

Make sure that you have successfully set up the Go environment and gomobile environment, and have installed Xcode on your Mac. If you are still experiencing issues, please provide detailed logs, as well as the version of your Mac and Xcode.

@kubbot
Copy link
Contributor

kubbot commented Apr 27, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@kubbot kubbot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 27, 2024
@kubbot
Copy link
Contributor

kubbot commented May 5, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@kubbot kubbot closed this as completed May 5, 2024
@github-actions github-actions bot reopened this Aug 8, 2024
@github-actions github-actions bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 8, 2024
@zhaolibo1989
Copy link
Contributor Author

Build on Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

3 participants