locked
Deployment Failure Because of System.Net.Http Version Differences? RRS feed

  • Question

  • User203781 posted

    I have a cross platform app that is currently working in UWP and iOS. I am trying now to finish integration with Android.

    I can successfully build the app, but when I attempt to deploy and debug, I am encountering the following warnings in Output and deployment fails:

    2>"C:\Projects\IdentityCheckpoint\VS2017\xSentry\Sentry\Sentry.Android\Sentry.Android.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
    2>(_ValidateAndroidPackageProperties target) -> 
    2>  C:\Projects\IdentityCheckpoint\VS2017\xSentry\Sentry\Sentry.Android\Properties\AndroidManifest.xml : warning XA4211: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '27' is less than $(TargetFrameworkVersion) ''. Using API-28 for ACW compilation.
    2>
    2>
    2>"C:\Projects\IdentityCheckpoint\VS2017\xSentry\Sentry\Sentry.Android\Sentry.Android.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
    2>(ResolveAssemblyReferences target) -> 
    2>  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2110,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
    

    With verbosity set high, I find this:

    2>      The ImageRuntimeVersion for this reference is "v4.0.30319". (TaskId:137)
    2>  There was a conflict between "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" and "System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". (TaskId:137)
    2>      "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was chosen because it was primary and "System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" was not. (TaskId:137)
    2>      References which depend on "System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Net.Http.dll]. (TaskId:137)
    2>          C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Net.Http.dll (TaskId:137)
    2>            Project file item includes which caused reference "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Net.Http.dll". (TaskId:137)
    2>              System.Net.Http (TaskId:137)
    2>      References which depend on "System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" []. (TaskId:137)
    

    I have tried to change the version of the DLL upwards, but can't.

    Suggestion?

    Friday, May 24, 2019 3:27 PM

Answers

  • User203781 posted

    The key was "AndroidManifest.xml : warning XA4211: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '27' is less than $(TargetFrameworkVersion) ''. Using API-28 for ACW compilation." I resolve the conflict by opening up AndroidManifest.xml and changed the target version "27" to "28".

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, May 28, 2019 12:36 AM

All replies

  • User371688 posted

    Could you please post the screenshot of the installed Nuget ?

    Monday, May 27, 2019 5:39 AM
  • User203781 posted

    The key was "AndroidManifest.xml : warning XA4211: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion '27' is less than $(TargetFrameworkVersion) ''. Using API-28 for ACW compilation." I resolve the conflict by opening up AndroidManifest.xml and changed the target version "27" to "28".

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Tuesday, May 28, 2019 12:36 AM