Xamarin.Swift
Xamarin.Swift copied to clipboard
msbuild command line build does not add SwiftSupport folder
Thank you for creating and sharing this project, it has been of great value to me and my team!
Up to now I have been archiving my builds manually through Visual Studio for Mac and everything works great.
From now on, however, I would like to build from the command line, but I noticed that the build targets that you created (_SwiftFrameworksMac
, _SwiftSupportIPA
, _SwiftSupportArchive
) don't seem to be executed with msbuild.
At least i don't see them in the output of msbuild and the created ipa does not include the SwiftSupport folder.
msbuild MyProject.sln \
/p:Configuration="Release" \
/p:Platform="iPhone" \
/p:BuildIpa="true" \
/p:ArchiveOnBuild="true" \
/t:Clean,Build
Maybe I'm just missing something here, can you give me a hint, please?
I'm having the same issue on Swift4 Library
@caldrian @volcano619 are you still having this issue?
Hi Lucas,
I still have the same issue. Maybe it's just the wrong command I use to build the app.
I created a simple project where the issue can be reproduced: (see the Makefile
)
SomeApp.zip
When I build the app in Visual Studio the output shows following lines and everything works:
Target _SwiftSupportIPA:
Looking for Swift version on: bin/iPhone/Release/SomeApp.app/Frameworks/SomeFramework.framework/SomeFramework
Expected Swift header on: bin/iPhone/Release/SomeApp.app/Frameworks/SomeFramework.framework/Headers/SomeFramework-Swift.h
bin/iPhone/Release/SomeApp.app/Frameworks/SomeFramework.framework/Headers/SomeFramework-Swift.h exists.
Including Swift dylibs because you are targeting an OS version that doesnt include it.
Installed: 5.2.2
SomeFramework Framework: 5.2.2
mkdir -p 'obj/iPhone/Release/ipa/SwiftSupport'; mkdir -p 'obj/iPhone/Release/ipa/SwiftSupport/iphoneos'; ls -1 'bin/iPhone/Release/SomeApp.app/Frameworks' | grep libswift | while read dylib; do '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo' "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/$dylib" -remove armv7s -remove arm64e -output "obj/iPhone/Release/ipa/SwiftSupport/iphoneos/$dylib";done
Target _ZipIpa:
...
However, when I build on the command line using
msbuild "./Xamarin/SomeApp.sln" \
/p:Configuration="Release" \
/p:Platform="iPhone" \
/p:IpaPackageDir="./bin/iPhone/Release" \
/t:Clean,Build
there is no output like above.
To further verify that something is incorrect I submitted the both created .ipa
files to TestFlight. The VisualStudio build works as expected, but the command line built app crashes on start-up.
Do you have any clue what mistake I am making?
Thank you very much! @Flash3001
Running the same command works on my projects. Are you your running the command on the same machine as your Visual Studio for Mac is running?
If nothing works you can use the following script https://github.com/Flash3001/ipa-packager/blob/master/package_ipa_default.sh to include the SwiftSupport folder on the IPA.
yes, on the same machine. okay, that will do as a workaround, thanks a lot!