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

[FEATURE?]: Issue with Output Directory Structure when Building iOS SDK using gomobile #55

Closed
zhaolibo1989 opened this issue Oct 28, 2024 · 3 comments

Comments

@zhaolibo1989
Copy link

What would you like to share?

Title: Issue with Output Directory Structure when Building iOS SDK using gomobile

Hello,

I'm experiencing an issue with the output directory structure when building our iOS SDK using gomobile. After upgrading our Go version, the directory structure generated for the iOS framework has changed, which is causing compatibility issues with our iOS app.

Here are the details of my environment and the issue:

  • Go Version: go1.23.1
  • Previous Go Version: [I DO NOT known]
  • Xcode Command Line Tools: Xcode 14.1

Previous Directory Structure:

OPENIMCORE.XCFRAMEWORK
│  Headers
│  Modules
│  OpenIMCore
│  Resources
│
└─Versions
    ├─A
    │  │  OpenIMCore
    │  │
    │  ├─Headers
    │  │      OpenIMCore.h
    │  │      Open_im_sdk.objc.h
    │  │      Open_im_sdk_callback.objc.h
    │  │      ref.h
    │  │      Universe.objc.h
    │  │
    │  ├─Modules
    │  │      module.modulemap
    │  │
    │  └─Resources
    │          Info.plist
    │
    └─Current
        │  OpenIMCore
        │
        ├─Headers
        │      OpenIMCore.h
        │      Open_im_sdk.objc.h
        │      Open_im_sdk_callback.objc.h
        │      ref.h
        │      Universe.objc.h
        │
        ├─Modules
        │      module.modulemap
        │
        └─Resources
                Info.plist

Current Directory Structure:

OPENIMCORE.XCFRAMEWORK
│  Info.plist
│
├─ios-arm64
│  └─OpenIMCore.framework
│      │  Info.plist
│      │  OpenIMCore
│      │
│      ├─Headers
│      │      OpenIMCore.h
│      │      Open_im_sdk.objc.h
│      │      Open_im_sdk_callback.objc.h
│      │      ref.h
│      │      Universe.objc.h
│      │
│      └─Modules
│              module.modulemap
│
└─ios-arm64_x86_64-simulator
    └─OpenIMCore.framework
        │  Info.plist
        │  OpenIMCore
        │
        ├─Headers
        │      OpenIMCore.h
        │      Open_im_sdk.objc.h
        │      Open_im_sdk_callback.objc.h
        │      ref.h
        │      Universe.objc.h
        │
        └─Modules
                module.modulemap

gomobile Command Used:

#!/bin/sh

VERSION=$(git describe --tags | sed -E 's/^v//')

echo VERSION: ${VERSION}

rm -rf build/ open_im_sdk/t_friend_sdk.go open_im_sdk/t_group_sdk.go  open_im_sdk/ws_wrapper/
GOARCH=arm64 gomobile bind -v -trimpath -ldflags "-s -w -X 'github.com/openimsdk/openim-sdk-core/v3/version.Version=${VERSION}'" -o build/OpenIMCore.xcframework -target=ios ./open_im_sdk/ ./open_im_sdk_callback/

The new directory structure is not compatible with our iOS app, and our developers are unable to use the SDK as expected. I've tried to troubleshoot by checking the gomobile version and ensuring that my environment is set up correctly, but the issue persists.

I would appreciate any guidance on how to resolve this issue or if there's a way to configure gomobile to generate the previous directory structure.

Thank you for your help!

Additional information

No response

@zhaolibo1989
Copy link
Author

The gomobile framework directory's generation code has been modified, with the commit log available here. For the code diff, you can check it out here.

As a workaround, you can use an earlier version of gomobile (v0.0.0-20240320162201-c76e57eead38) by running the following commands:

go get golang.org/x/[email protected]
go install golang.org/x/mobile/cmd/[email protected]

This version corresponds to a point in time before the aforementioned code changes were made.

@FGadvancer FGadvancer transferred this issue from openimsdk/openim-sdk-core Oct 29, 2024
@std-s
Copy link
Member

std-s commented Nov 4, 2024

@zhaolibo1989 Hi, the go version we currently package xcframework for is 1.22.7; the xcode version is Version 15.2.

@std-s
Copy link
Member

std-s commented Dec 2, 2024

There has been no news for a long time, so I will close this issue first.

@std-s std-s closed this as completed Dec 2, 2024
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

2 participants