xcodebuild error while generating xcframework library

I'm trying to create xcframework of j2objc built by make dist.


Presumerbly those .a files are compiled as fat library, but built with xCode10 due to compile errors when compile with xCode11.

My build environments are xCode11 beta 2 and MacOS 10.5 beta.


$ xcodebuild -create-xcframework -library ./lib/libjre_emul.a -library ./lib/macosx/libjre_emul.a -headers ./include/ -output lib/universal/libjre_emul.xcframework  
error: binaries with multiple platforms are not supported './j2objc/dist/lib/libjre_emul.a'

How can I solve this?

Post not yet marked as solved Up vote post of Owen Jung Down vote post of Owen Jung
3.5k views

Replies

Has anyone been able to create an xcframework with a static library. Anyone? Anyone?

Wonder this too!

After several days of working with making xcodebuild with -create-xcframework I figured out how to make.

Have to use .a library compiled for only one device cup architecture, that means .a library before making fat library.


xcodebuild -create-xcframework \
-library jre_emul/build_result/objs-macosx/libjre_emul.a -headers dist/include/ \
-library jre_emul/build_result/objs-iphone64/libjre_emul.a -headers dist/include/ \
-library jre_emul/build_result/objs-simulator64/libjre_emul.a -headers dist/include/ \
-output dist/lib/universal/libjre_emul.xcframework


then you can get a success message:


xcframework successfully written out to: /Users/op1000/Documents/9folders/src/j2objc/src-j2objc-working/dist/lib/universal/libjre_emul.xcframework


The output is a folder not a file. you can find .a library file is located in the xcframework folder and it seems to be copied.