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

Xamarin.Android Application does not recognize Paket Nuget packages #2396

Closed
ghost opened this issue Jun 6, 2017 · 8 comments
Closed

Xamarin.Android Application does not recognize Paket Nuget packages #2396

ghost opened this issue Jun 6, 2017 · 8 comments

Comments

@ghost
Copy link

ghost commented Jun 6, 2017

Created 2 identical Xamarin.Android (7.1) applications on Visual Studio for Mac.

When I add any NuGet package directly from NuGet, the packages are recognized by the solution and can be built successfully.

When I add the same NuGet package using Paket. The packages are not recognized by the solution.

I tried both Paket version 4.8.7 and the latest beta 008.

With the other types of projects (libraries, PCL, etc) everything works as expected.

Any ideas??

@forki
Copy link
Member

forki commented Jun 6, 2017 via email

@ghost
Copy link
Author

ghost commented Jun 7, 2017

TestPaket.zip

I created 2 projects in the solution, out of 3 packages, only 1 is recognized.

  • SimpleInjector (not recognized)
  • Xamarin.Android.Support.v4 (ok)
  • System.Reactive.Core (not recognized)

I also included the log from the paket add commands.

@ghost
Copy link
Author

ghost commented Jun 10, 2017

Hi,

I tried with version 5.0.0-rc003 and I still have the same issue.

@matthid
Copy link
Member

matthid commented Jun 10, 2017

@DrifterApps I'm not sure what to do to be honest. Do you get any warning/error or what do I have to do exactly? I have no Mac btw.

@ghost
Copy link
Author

ghost commented Jun 10, 2017

@matthid I'm not sure what to tell you besides that I'm not getting any errors.

I did a test (which worked) by manually adding MonoAndroid to my target for SimpleInjector version .NETStandard 1.3 because that is the version being reference when I install the package using NuGet.

I manually added this reference:
($(TargetFrameworkIdentifier) == 'MonoAndroid') Or

Is it as though Paket cannot determine that the TargetFrameworkIdentifier MonoAndroid should be added and where...

  <Choose>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.0.3')">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\net40\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7')">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\net45\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2')) Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1'))">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\netstandard1.0\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
    <When Condition="($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == '.NETCore' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0'))">
      <ItemGroup>
        <Reference Include="SimpleInjector">
          <HintPath>..\packages\SimpleInjector\lib\netstandard1.3\SimpleInjector.dll</HintPath>
          <Private>True</Private>
          <Paket>True</Paket>
        </Reference>
      </ItemGroup>
    </When>
  </Choose>

@matthid
Copy link
Member

matthid commented Jun 10, 2017

Ah so paket is not recognizing that SimpleInjector is compatible with monoandroid. Yes we miss the corresponding entries in paket.

@ghost
Copy link
Author

ghost commented Jun 10, 2017

Yes but just to be clear it's not just SimpleInjector... most packages I install do not get recognized unless they are specifically designed for MonoAndroid.

@matthid
Copy link
Member

matthid commented Jun 10, 2017

Yep I'm fixing that right now :). At least portable packages should work already. Just netstandard ones are currently not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants