serilog / serilog-sinks-xamarin

A Serilog sink that writes events to Xamarin mobile targets
Apache License 2.0
55 stars 18 forks source link

Serilog.Sinks.Xamarin NuGet can not be added for iOS and Android #3

Closed neooleg closed 7 years ago

neooleg commented 8 years ago

Issue

this is impossible to add Serilog.Sinks.Xamarin for both iOS and Android projects. Tried all versions of the sink (0.1.14 - 0.1.18).

The following error appeared (e.g. for Android):

Attempting to gather dependency information for package 'Serilog.Sinks.Xamarin.0.1.18' with respect to project 'test.Droid', targeting 'MonoAndroid,Version=v6.0'
Attempting to resolve dependencies for package 'Serilog.Sinks.Xamarin.0.1.18' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Serilog.Sinks.Xamarin.0.1.18'
Resolved actions to install package 'Serilog.Sinks.Xamarin.0.1.18'
For adding package 'Serilog.0.1.6' to project 'test.Droid' that targets 'monoandroid60'.
Install failed. Rolling back...
Package 'Serilog.0.1.6' does not exist in project 'test.Droid'
Package 'Serilog.0.1.6' does not exist in folder ...
Could not install package 'Serilog 0.1.6'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Environment

Xamarin Studio Community Version 6.1.1 (build 15) Installation UUID: XXX Runtime: Mono 4.6.1 (mono-4.6.0-branch-c8sr0/abb06f1) (64-bit) GTK+ 2.24.23 (Raleigh theme) Package version: 406010003

NuGet Version: 3.4.3.0

Xamarin.Profiler Not Installed

Apple Developer Tools Xcode 7.3.1 (10188.1) Build 7D1014

Xamarin.Android Version: 7.0.1.2 (Xamarin Studio Community) Android SDK: /Users/XXX/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 6.0 (API level 23)

SDK Tools Version: 25.1.2 SDK Platform Tools Version: 24.0.0 SDK Build Tools Version: 23.0.2

Java SDK: /usr java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Android Player Not Installed

Xamarin.iOS Version: 10.0.1.8 (Xamarin Studio Community) Hash: 3983064 Branch: cycle8-sr0-xi Build date: 2016-09-23 15:34:54-0400

Xamarin.Mac Version: 2.10.0.103 (Xamarin Studio Community)

Build Information Release ID: 601010015 Git revision: fa52f02641726146e2589ed86ec4097fbe101888 Build date: 2016-09-22 08:03:02-04 Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6 Build lane: monodevelop-lion-cycle8-sr0

stefandevo commented 8 years ago

I think there is a dependency that causes the problem (Newtonsoft). Just add Newtonsoft.Json as a package first, then add this package. But the nuspec should get an update to remove the dependency - it's not just I think.

neooleg commented 8 years ago

Hi @stefandevo, thanks for responding!

Newtonsoft.Json is already installed (latest version), but issue is still there.

The strange thing is that Serilog.Sinks.Xamarin trying to install the oldest in NuGet Serilog 0.1.6. Do you know why?

BTW, yep Serilog 0.1.6 really can not be installed for e.g. iOS project, however, the latest Serilog 2.3.0 installs fine as it expected.

stefandevo commented 8 years ago

I installed serilog first in ios and android. Then added the xamarin sink. That should work.

stefandevo commented 8 years ago

Problem is that the nuspec is wrong. It takes the "min" dependency id for Serilog. So my suggestion works (install NewtonJson and Serilog manually). I created a pull request for fixing this.. @ghuntley

neooleg commented 8 years ago

Thanks, the suggestion works 👍

ghuntley commented 7 years ago

This has been resolved thanks to @stefandevo's PR - v0.1.25 is now available on NuGet.org