Forum Xamarin Xamarin.Forms

Unable to build application (nugets?)

Hi guys.

I've got a super-basic XF application that initially ran into a problem where a reference to a nuget wasn't updated (I just updated to the latest version of Xamarin, and the nuget versions didn't seem to have followed suit); I think it was AppCompat and RecylerViewer as per a different thread.

However, after having followed said thread I'm not encountering this issue:

Error 132 java.lang.IllegalArgumentException: already added : Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 2072 3 FirstApp.Droid

This is the line it's referring to:

  <CompileToDalvik 
    Condition="'$(UseJackAndJill)'!='True'"
    DxJarPath="$(DxJarPath)"
    JavaToolPath="$(JavaToolPath)"
    JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
    JavaOptions="$(JavaOptions)"
    ClassesOutputDirectory="$(IntermediateOutputPath)android\bin\classes"
    ToolPath="$(DxToolPath)"
    ToolExe="$(DxToolExe)"
    UseDx="$(UseDx)"
    MultiDexEnabled="$(AndroidEnableMultiDex)"
    MultiDexMainDexListFile="$(_AndroidMainDexListFile)"
    JavaLibrariesToCompile="@(_JavaLibrariesToCompileForAppDx)"
    OptionalObfuscatedJarFile="$(IntermediateOutputPath)proguard\__proguard_output__.jar"
  />

I assumed there either could be a circular dependency or that other nuget packages are out of date. So I attempted to update my other nugets, but am told by the nuget manager that there are no compatible content files refering to xamarin.ios, version=1.0:

Install-Package : Could not install package 'Xamarin.Android.Support.Compat 24.2.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.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.
At line:1 char:1

For reference I've cleaned - built, cleaned - rebuilt etc, but nothing seems to fix the underlying issue(s)...

Best Answer

Answers

  • seanydaseanyda GBMember ✭✭✭✭✭

    You're not suppose to update the android packages. You update the Xamarin.Forms package only and it'll update them packages if it has dependencies for them.

  • Huh... That's a bit odd, then. I followed marked answer on a question that was very similar to mine... Any suggestion(s) on how I go about fixing my project, then?

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @JoakimBajoulKakaei.9989

    As @lpdavies said: Don't ever update the Android.Support packages. Ever.
    https://redpillxamarin.wordpress.com/2016/12/23/202-starting-on-the-right-foot/

    At this point you might be able to fix things by uninstalling Xamarin.Forms NuGet package then installing just the Xamarin.Forms NuGet. It will get the support libraries it needs.

Sign In or Register to comment.