Tencent / MMKV

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, and POSIX.
Other
17.2k stars 1.89k forks source link

MMKV failed to build on iOS v1.3.5 #1286

Closed Kyle-Ye closed 1 month ago

Kyle-Ye commented 3 months ago

Note:

An crash issue will be ignored & closed in a week without logs.

The language of MMKV

e.g. Objective-C, Swift, Java, or Kotlin

Objective-C & Swift

The version of MMKV

e.g. v1.2.2
Note: For versions older than the latest version, please upgrade before posting any issue.
We don't have much time for old version tech support.

v1.3.5

The platform of MMKV

e.g. iOS or Android

iOS

The installation of MMKV

e.g. Cocoapods, Maven, or Git clone

Other

What's the issue?

Post the outputs or screenshots for errors.

Explain what you want by example or code in English. If you have a crash/OOM/ANR on Android, please provide symbolize stack traces. https://developer.android.com/ndk/guides/ndk-stack.html

I maintained a binary distribution of MMKV by running xcodebuild archive and xcodebuild -create-xcframework

Upstream has confirmed that binary support will not not supported or merged. See #866

But this is an issue out of scope of binary product IMO.

Things used to be fine. But when I bump from 1.3.0 to the latest 1.3.5 version. I noticed the CI is failing.

The CI script I'm using can be found here https://github.com/Kyle-Ye/MMKV/blob/master/iOS/archive_xcframework.sh

Cloning the corresponding version locally, I found that MMKV-Static build fine while MMKV can not build now.

Steps to reproduce

  1. git clone https://github.com/Tencent/MMKV.git and switch to version 1.3.5 / master branch
  2. Open MMKV.xcworkspace or iOS/MMKV/MMKV.xcodeproj
  3. Choose MMKV schema and run build or archive
image

Workaround I have tried

I tried to replace -scheme MMKV to -scheme 'MMKV Static'

And then build the xcframework with the following command.

xcodebuild \
-create-xcframework \
-archive archives/MMKV-iOS.xcarchive -library libMMKV.a \
-archive archives/MMKV-macOS.xcarchive -library libMMKV.a \
-archive archives/MMKV-iOS-Simulator.xcarchive -library libMMKV.a \
-output archives/MMKV-Static.xcframework

But since there is no .h or modulemap file produced in the xcarchive folder. I can't import anything on the client side.

xcodebuild archive \
-workspace MMKV.xcworkspace \
-scheme 'MMKV Static' \
-configuration Release \
-destination "generic/platform=iOS Simulator" \
-archivePath "archives/MMKV-iOS-Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

MMKV-iOS.xcarchive
├── Info.plist
├── Products
│   └── usr
│       └── local
│           └── lib
│               ├── libMMKV.a
│               └── libMMKVCore.a
└── dSYMs

What's the log of MMKV when that happened?

Your detail logs. As much as possible. For how to forward MMKV's log, you can checkout the wiki on each platform. An crash issue will be ignored & closed in a week without logs.

None

lingol commented 3 months ago

It's fixed in the dev branch. You can cherry-pick into your local clone. 52963d3

Kyle-Ye commented 3 months ago

It's fixed in the dev branch. You can cherry-pick into your local clone. 52963d3

Thanks, can we get an expectation timeline for the next release which will contain the fix?

lingol commented 3 months ago

Not in any time soon.

Thanks, can we get an expectation timeline for the next release which will contain the fix?

Kyle-Ye commented 3 months ago

Got it. I'll use a local fork then.

lingol commented 1 month ago

It's released in v1.3.6.