reactiveui / Pharmacist

Builds observables from events.
MIT License
239 stars 15 forks source link

[BUG] Can't build : System.NullReferenceException on Xamarin.Android #119

Closed Lapinou42 closed 3 years ago

Lapinou42 commented 4 years ago

Describe the bug

/Users/Christophe/.nuget/packages/pharmacist.msbuild/1.5.15/buildTransitive/netstandard2.0/Pharmacist.MSBuild.targets(48,5): error : PharmacistNuGetTask: System.NullReferenceException: Object reference not set to an instance of an object /Users/Christophe/.nuget/packages/pharmacist.msbuild/1.5.15/buildTransitive/netstandard2.0/Pharmacist.MSBuild.targets(48,5): error : at NuGet.Protocol.DownloadResourceV3.GetDownloadUrl (NuGet.Packaging.Core.PackageIdentity identity, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x0007a] in <83330316d0b44741910fff5cb41b7909>:0 /Users/Christophe/.nuget/packages/pharmacist.msbuild/1.5.15/buildTransitive/netstandard2.0/Pharmacist.MSBuild.targets(48,5): error : at NuGet.Protocol.DownloadResourceV3.GetDownloadResourceResultAsync (NuGet.Packaging.Core.PackageIdentity identity, NuGet.Protocol.Core.Types.PackageDownloadContext downloadContext, System.String globalPackagesFolder, NuGet.Common.ILogger logger, System.Threading.CancellationToken token) [0x000bd] in <83330316d0b44741910fff5cb41b7909>:0 /Users/Christophe/.nuget/packages/pharmacist.msbuild/1.5.15/buildTransitive/netstandard2.0/Pharmacist.MSBuild.targets(48,5): error : at Pharmacist.Core.NuGet.NuGetPackageHelper+<>c__DisplayClass17_0.b__4 (System.ValueTuple`2[T1,T2] item) [0x00094] in <9df0e4b5ad784380b78db0d845007e4b>:0

Screenshots

Capture d’écran 2020-03-12 aΜ€ 14 16 28

Environment OS: Mac OS 10.15.3 (19D76) Android SDK version: 10 VS version: 8.4.8 (build 2) ReactiveUI versions: 11.2.3 (ReactiveUI, ReactiveUI.AndroidX, ReactiveUI.AndroidSupport) Pharmacist version: 1.5.15

Additional context

open-collective-bot[bot] commented 4 years ago

Hey @Lapinou42 :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.

https://opencollective.com/reactiveui

PS.: We offer priority support for all financial contributors. Don't forget to add priority label once you start contributing :smile:

ReactiveUI - Open Collective
An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!
Lapinou42 commented 4 years ago

Seems similar to https://github.com/reactiveui/Pharmacist/issues/77, I have also private nugets.

Lapinou42 commented 4 years ago

I found a workaround :

<ItemGroup>
    <PackageReference Include="Pharmacist.MsBuild" Version="1.*" PrivateAssets="all" />
    <PackageReference Include="Pharmacist.Common" Version="1.*" />
</ItemGroup>

pharmacist generate-platform -p android -o c:/directory/for/output --output-prefix="Events_"

glennawatson commented 4 years ago

Can you attach the project file you were trying to generate for? Something is generating empty package references.

chrisgate commented 4 years ago

@glennawatson i think by creating new Xamarin.Forms project gives this error.....but by removing Pharmacist.MSBuild made it build

glennawatson commented 4 years ago

You would normally add Pharmacist to your netstandard project btw for Xamarin Forms.

chrisgate commented 4 years ago
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <ProduceReferenceAssembly>true</ProduceReferenceAssembly>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>portable</DebugType>
    <DebugSymbols>true</DebugSymbols>
    <PharmacistGlobalPackages>true</PharmacistGlobalPackages>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Prism.DryIoc.Forms" Version="8.0.0.1539-ci" />
    <PackageReference Include="ReactiveUI" Version="11.2.3" />
    <PackageReference Include="ReactiveUI.Fody" Version="11.2.3" />
    <PackageReference Include="Tsl.AsciiProtocol.Std" Version="1.4.3" />
    <PackageReference Include="Xamarin.Forms" Version="4.5.0.356" />
    <PackageReference Include="Xamarin.Essentials" Version="1.5.1" />
    <PackageReference Include="Xamarin.Forms.PancakeView" Version="1.3.7" />
    <PackageReference Include="Pharmacist.Common" Version="1.5.15" />
  </ItemGroup>

  <ItemGroup>
    <EmbeddedResource Update="Views\DashboardPage.xaml">
      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
    </EmbeddedResource>
    <EmbeddedResource Update="Views\LoginPage.xaml">
      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
    </EmbeddedResource>
    <EmbeddedResource Update="Views\ManageEventsPage.xaml">
      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
    </EmbeddedResource>
    <EmbeddedResource Update="Views\SetDrawer.xaml">
      <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
    </EmbeddedResource>
  </ItemGroup>
</Project>
chrisgate commented 4 years ago

thats my csproj. i added it to forms

glennawatson commented 3 years ago

See https://www.nuget.org/packages/ReactiveMarbles.ObservableEvents.SourceGenerator/ and https://github.com/reactivemarbles/ObservableEventsSourceGenerator

This won't use it's own nuget integration anymore, instead will use dotnet one.

ReactiveMarbles.ObservableEvents.SourceGenerator 1.0.2
Allows to get an observables for property changed events.
GitHub
reactivemarbles/ObservableEventsSourceGenerator
Contribute to reactivemarbles/ObservableEventsSourceGenerator development by creating an account on GitHub.
github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.