Flash3001/Xamarin.Swift

error MSB4044: The "CompileEntitlements" task was not given a value for the required parameter "AppBundleDir"

tuyen-vuduc opened this issue · 4 comments

Hey @tuyen-vuduc just pushed everything I had offline.

I was checking the mentioned issue. Is the project you are having issues a binding library? This Xamarin.Swift package is not intended to be included as compilation dependency for your binding, but instead for the final apps using the binding.

The only function for this script is to include the Swfit dylibs in the final .IPA. Not to include the Swift dylibs in the the library itself.

So on if PPRiskMagnes.iOS does use Swift code then https://www.nuget.org/packages/PPRiskMagnes.iOS#dependencies-body-tab it should list Xamarin.Swift as a dependency. Not on https://github.com/xbindings/ppriskmagnes-xamarin-ios/blob/b4cb52a571aacf580b180b94862e1f8e15500bc8/PPRiskMagnes.iOS/PPRiskMagnes.iOS.csproj#L76.

Please check this as an example:

https://github.com/Flash3001/iOSCharts.Xamarin/blob/master/iOSCharts.csproj (no dependency)
https://www.nuget.org/packages/iOSCharts#dependencies-body-tab (Xamarin.Swift is listed there to be automatically included in your user's projects)

I hope I understood the problem correctly and that this helps

Please let me know =D

@Flash3001 You're right, I worked it that way for now.
The error only happens when I target .NET6+, not the Xamarin.iOS, so I think there should a way.

If we add the package to csproj file, when we build our package, it will be in the list of dependencies.

If not, how do we add this package as a dependency? Manually?

That is a good question, I don't know.

Unfortunately I am still stuck on pre-NET6 for all projects I work on so I haven't tried anything related to it yet. Neither bindings or apps.

For the iOSCharts library I did include it manually when creating the .nuget package, but I suppose there was a way to automate it.

If adding the PackageReference will indeed cause it to appear as a dependency on the NuGet package we need to figure out a way to prevent the script from running when compiling the binding. It can't be consumed, only passed forward to your user.

Please let me know if you figure out how to do it, I am curious now. I was doing a quick check on the PackageReference docs and I saw that is possible to do the opposite (consume, but not pass forward). My brain is already sleeping (2 am here) hehe.