redth-org / BTProgressHUD

Port to Xamarin.iOS of the SVProgressHUD
Other
118 stars 64 forks source link

Add NuGet to Maui Project #101

Closed criistii closed 1 year ago

criistii commented 1 year ago

Hey, I am having issues adding the 2.0 nuget to a new Maui project in Visual Studio for Mac. Any idea what is going on?

Cheesebaron commented 1 year ago

You need to provide more details.

criistii commented 1 year ago

Sorry for the delay. Steps to reproduce: on MacOS Ventura > VS 17.5.4 (build 8) > Create a new Maui project from the Terminal > Open it > Manage Nuggets for the iOS Platform> Find & Add BTProgressHUD > "Could not add BTProgressHUD"

Tried to add it to iOS only and still got the following error: Package BTProgressHUD 2.0.0 is not compatible with net7.0-android33.0

Cheesebaron commented 1 year ago

Yes, BTProgressHUD is not compatible with Android. I don't know why your package manager is trying to add it to the Android project, but that is not a supported use case.

You may have to add it manually to your csproj file only for your iOS target.

criistii commented 1 year ago

Just tried adding it in the csproj using <PackageReference Include="BTProgressHUD" Version="2.0.0" Condition="'$(TargetFramework)' == 'net7.0-ios'" /> but it did not work. By any chance, you have a working example? Would be great if this info was in the documentation.

Cheesebaron commented 1 year ago

You will probably have to have the condition on an ItemGroup:

<ItemGroup Condition=" $(TargetFramework.StartsWith('net7.0-ios')) ">
    <PackageReference Include="BTProgressHUD" Version="2.0.0" />
</ItemGroup>
criistii commented 1 year ago

Sadly, it's not working. Probably a VS issue.

Cheesebaron commented 1 year ago

I created a blank MAUI project, added:

<ItemGroup Condition=" $(TargetFramework.StartsWith('net7.0-ios')) ">
    <PackageReference Include="BTProgressHUD" Version="2.0.0" />
</ItemGroup>

Works fine when I run: dotnet restore

What is the error you are seeing?

Cheesebaron commented 1 year ago

Closing this as there is no reply for 2 weeks.