-
Notifications
You must be signed in to change notification settings - Fork 525
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
Akavache should install portable classes instead of net45 on a Xamarin.Android project #676
Comments
/cc @christianlang ideas? |
@mikescandy can you specify the version of Akavache you're using? The current version 4.1.0 of akavache.core (the package "akavache" itself doesn't contain files) has a dedicated MonoAndroid build which I assume should be used. |
I general Paket prefers builds for specific platforms over portable builds, just like NuGet does. For the reasoning behind this, please see this discussion: #380 (comment). Maybe this doesn't make sense for .NET builds on Xamarin.Android. Not sure how compatible they are. |
Why do you think it should reference the portable version? Shouldn't it reference akavache.core/lib/MonoAndroid/Akavache.dll because that's exactly the platform you need? (I'm not saying there is no bug, I'm just trying to understand the issue.) |
Ok, you're right, I didn't explain the problem properly, sorry for that! Installing "akavache" with nuget on a Xamarin.Android app I get references to:
Installing "akavache" with paket on a Xamarin.Android app I get references to:
and an extra reference to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\WindowsBase.dll
hopefully this will help shed a bit of light on this. |
Thanks, that's very helpful now :) Newtonsoft.Json is where it breaks, it seems (among others). NuGet references I'm trying to find a rule here that we can implement. Problem is that we don't even try to determine the NuGet doesn't seem to do the right thing either, by the way. From the screenshot you posted I see that Profile 259 seems to support Xamarin.Android. So why does NuGet prefer the older Profile 136 build over the dll in Can you please explain specifically why .NET 4.5 is the wrong version to take here? Is Xamarin.Android not very compatible with .NET 4.5? Is it better to go with .NET 4 in general? Maybe that's an angle to tackle it from. Sorry that I'm asking more questions than giving answers. |
well, the main issue is that Paket is bringing in Rx-Xaml\lib\net45\System.Reactive.Windows.Threading.dll (v. 2.2.5) and WindowsBase as a reference, which is obviously not related to Android and breaks the project regarding the newtonsoft reference, I don't think it's a big issue. Not sure what's happening there, but on a different project it's importing packages\Newtonsoft.Json.6.0.8\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll (profile328 I think) which makes sense. OT: the profile thing is a mess... |
Could it be that the issue is related to the "bait and switch" trick (http://log.paulbetts.org/the-bait-and-switch-pcl-trick/ from @paulcbetts )? |
Yes, this pattern is the reason why we implemented Paket the way it is. It's why we pick the .NET version of Rx instead of the portable version. See #380 (comment). That's why I'm not sure how/if we can solve this problem. |
fair enough, thanks for the time spent on this anyway 👍 i'm reverting to plain nuget, but paket remains a fantastic tool to inspect package dependencies! |
Can we solve this with special casing? |
Since Rx is a very common library a special case for this would make sense, I think. Is that what you mean? We could also try to manipulate our rules to prefer a portable build over a .NET build for Android, but that would probably break other packages using the "bait and switch" trick. So a special case for Rx sounds good to me. |
I'd love to see a PR which special cases Rx
|
From the Akavache side, most of those look right, so does SQLitePCL_Raw |
Because you provide excellent cross-platform support as usual :) |
Don't special case RX, the support for PCLs in NuGet is shaky at best but you can draw from the rules here https://github.com/NuGet/NuGet3/blob/dev/src/NuGet.Frameworks/FrameworkReducer.cs#L46. This is the new NuGet v3 client. This logic should return the "best match" given a "target" target framework and a list of target frameworks. This includes the mess that is portable-* |
Closing old issue. Hope everything will be fine with .NET Standard |
When installing Akavache (nuget akavache) to a Xamarin.Android project targeting Api 21, Paket adds references to dlls from the net45 folders, instead of the portable ones (portable-windows8+net45+wp8 which should be equivalent to profile 259). As a side effect, it also adds references to System.Reactive.Windows.Threading and WindowsBase, which are obviously not available on Android.
I tried to force the framework in the references for the project but with no luck.
The text was updated successfully, but these errors were encountered: