2

I made a new blank cross-platform project using a portable class library in visual studio, BUT when I try to build a platform project I have a list of errors:

Error   CS0117  'Resource' does not contain a definition for 'Animation'
Error   CS0117  'Resource' does not contain a definition for 'Boolean'
Error   CS0117  'Resource' does not contain a definition for 'Color'
Error   CS0117  'Resource' does not contain a definition for 'Dimension'
Error   CS0117  'Resource' does not contain a definition for 'Id'   App5.Droid
Error   CS0117  'Resource' does not contain a definition for 'Integer'
Error   CS0117  'Resource' does not contain a definition for 'Layout'
Error   CS0117  'Resource' does not contain a definition for 'Style'
Error   CS0117  'Resource' does not contain a definition for 'Styleable'
Error   CS0117  'Resource.Attribute' does not contain a definition for 'actionBarDivider'
Error   CS0117  'Resource.Attribute' does not contain a definition for 'actionBarItemBackground'
Error   CS0117  'Resource.Attribute' does not contain a definition for 'actionBarPopupTheme'
Error   CS0117  'Resource.Attribute' does not contain a definition for 'actionBarSize'
Error   CS0117  'Resource.Attribute' does not contain a definition for 'actionBarSplitStyle'

Keep in mind that I'm trying to update NuGet Packages, BUT when I selected all packages with (Xamarin.forms), the update didn't work and the following error appeared:

Unable to find a version of 'Xamarin.Android.Support.v4' that is compatible with 'Xamarin.Android.Support.Animated.Vector.Drawable 23.2.1 constraint: Xamarin.Android.Support.v4 (= 23.2.1)', 'Xamarin.Android.Support.Design 23.0.1.3 constraint: Xamarin.Android.Support.v4 (>= 23.0.1.3)', 'Xamarin.Android.Support.v13 23.3.0 constraint: Xamarin.Android.Support.v4 (= 23.3.0)', 'Xamarin.Android.Support.v7.AppCompat 23.0.1.3 constraint: Xamarin.Android.Support.v4 (>= 23.0.1.3)', 'Xamarin.Android.Support.v7.MediaRouter 23.0.1.3 constraint: Xamarin.Android.Support.v4 (>= 23.0.1.3)', 'Xamarin.Android.Support.v7.RecyclerView 23.0.1.3 constraint: Xamarin.Android.Support.v4 (>= 23.0.1.3)', 'Xamarin.Android.Support.Vector.Drawable 23.2.1 constraint: Xamarin.Android.Support.v4 (= 23.2.1)', 'Xamarin.Forms 2.1.0.6529 constraint: Xamarin.Android.Support.v4 (= 23.0.1.3)'.

So, I selected all packages except the Xamarin.forms package and updated them.

Any idea on how to fix this error?

ragingasiancoder
  • 616
  • 6
  • 17
Afnan Khalifa
  • 119
  • 1
  • 2
  • 7

2 Answers2

2

You need to use the specific/minimium versions of the packages that are mentioned in the error message. The safest way to do it is to remove all nuget packages (including Xamarin.Forms) and then add Xamarin.Forms nuget package, which will add all its dependencies with the specific versions.

Explanation, by James Montemagno:

Xamarin.Forms locks in a very specific version of the support libraries and google play services. You can't update them because Xamarin.Forms isn't compatible with them as it would need to be re-compiled.

Xamarin.Android.Support.v4 (= 23.0.1.3)

Xamarin.Android.Support.Design (= 23.0.1.3)

Xamarin.Android.Support.v7.AppCompat (= 23.0.1.3)

Xamarin.Android.Support.v7.CardView (= 23.0.1.3)

Xamarin.Android.Support.v7.MediaRouter (= 23.0.1.3)

See the = 23.0.1.3, which means it is only compatible with that version number. This is just how NuGet works. When Xamarin.Forms updates these packages will auto update.

Luis Beltran
  • 1,704
  • 12
  • 13
  • Thanks, I removed all packages and reinstall Xamarin.Forms package, BUT I have another error : "GenerateResourceDesigner" task failed unexpectedly. – Afnan Khalifa Apr 24 '16 at 08:49
  • Check if this works for you: http://stackoverflow.com/questions/35631572/xamarin-generateresourcedesigner-task-failed-unexpectedly-and-dll-file-could > Solution to this was to reinstall the xamarin forms for android [...] and then delete the bin and obj folder for all directories along with the packages. – Luis Beltran Apr 24 '16 at 10:37
  • I solved this by starting over and created a Xamarin Forms PCL solution/ I changed nothing and clicked Run. It opened up an Droid emulator and displayed. Then step by step I got it to run to my Windows 10 phone, with UWP as the start up project and ARM, Device as the target. // Earlier I had 1600 errors like above, by trying to run to ARM Device, (my phone) immediately after creating the project. Also at that time I unchecked a bunch of boxes in Configuration. Its like the IDE/Xamarin wasn't ready for me to switch around all its defaults at that point. HTH, – pdschuller Jul 12 '16 at 02:01
0

I have created a new Xamarin.forms project (blank shared) with VS2015 Update 3 RC and similar problems (and more, e.g. 'Resource.Attribute' does not contain a definition for 'actionBarSize'.
The problem was the sub-version of JDK (Update 55 instead of Update 79).
You can find my posting to the Resource.Attribute error here: JDK7 problem

Community
  • 1
  • 1
FredyWenger
  • 2,236
  • 2
  • 32
  • 36