Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Lapinou42 opened this issue Mar 12, 2020 · 10 comments
Closed
Labels
bug Something isn't working

Comments

@Lapinou42
Copy link

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 à 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

@Lapinou42 Lapinou42 added the bug Something isn't working label Mar 12, 2020
@open-collective-bot
Copy link

open-collective-bot bot commented Mar 12, 2020

Hey @Lapinou42 👋,

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 😄

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!

@Lapinou42 Lapinou42 changed the title [BUG] Can't build : System.NullReferenceException [BUG] Can't build : System.NullReferenceException on Xamarin.Android Mar 12, 2020
@Lapinou42
Copy link
Author

Seems similar to #77, I have also private nugets.

@Lapinou42
Copy link
Author

Lapinou42 commented Mar 12, 2020

I found a workaround :

  • I removed Pharmacist.MSBuild and hold just Pharmacist.Common
  • I removed theses lines from my .csproj:
<ItemGroup>
    <PackageReference Include="Pharmacist.MsBuild" Version="1.*" PrivateAssets="all" />
    <PackageReference Include="Pharmacist.Common" Version="1.*" />
</ItemGroup>
  • I generated the file using this command and add it to my project:

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

@glennawatson
Copy link
Contributor

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

@chrisgate
Copy link

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

@glennawatson
Copy link
Contributor

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

@chrisgate
Copy link

chrisgate commented Mar 13, 2020

<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
Copy link

thats my csproj.
i added it to forms

@glennawatson
Copy link
Contributor

glennawatson commented May 29, 2021

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.

Allows to get an observables for property changed events.
GitHub
Contribute to reactivemarbles/ObservableEventsSourceGenerator development by creating an account on GitHub.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants