6

I'm referencing this solution/question The type or namespace name 'Xamarin' missing in xamarin studio

However its still not possible to build the app from a new universal app project wizard.

Severity    Code    Description Project File    Line    Suppression State
Error   CS0117  'Resource.Attribute' does not contain a definition for 'actionBarSize'  
Project.Droid   C:\dev\Project.Droid\Resources\Resource.Designer.cs 29  Active

Any ideas from the new-to-Xamarin crowd?

Community
  • 1
  • 1
Israel Lopez
  • 1,135
  • 3
  • 11
  • 25
  • What version of Xamarin.Forms are you using? Secondly what version of the respective Google Support Libraries are referenced? – Jon Douglas Apr 01 '16 at 03:25
  • 2.1.0.6529 is currently installed from when I added it in via NuGet. I'm not sure if the google support libraries are installed. – Israel Lopez Apr 01 '16 at 03:35
  • Can you paste the contents of your `Resource.desginer.cs` file? Perhaps in a gist. – Jon Douglas Apr 01 '16 at 03:40
  • We would be after finding a line of code along the lines of: `public const int actionBarSize = 2130772085;` If you do not have an element like that in your `Resource.designer.cs` file, please try to reinstall Xamarin.Forms via NuGet and delete the `Resource.designer.cs` file. Try to compile again and the file will be hidden, re-add that to your solution. – Jon Douglas Apr 01 '16 at 03:42
  • Here is the gist requested. https://gist.github.com/ilopez/6064f808c50cc6179e37686fbb9cdee7 I'll look for the code mentioned. – Israel Lopez Apr 01 '16 at 04:01
  • It doesn't seem to be present. Can you please try the steps above? Also nuke your `bin/obj` folders while you're at it. – Jon Douglas Apr 01 '16 at 04:02
  • Right, deleted Resource.designer.cs, reinstalled Xamarin.Forms, deleted bin & obj folders. Now have on build. Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. – Israel Lopez Apr 01 '16 at 04:09
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/107914/discussion-between-jon-douglas-and-israel-lopez). – Jon Douglas Apr 01 '16 at 04:10

1 Answers1

4

Okay here's the answer! I had a local reproduction of this and it seems that there are some references missing in the .csproj:

Please ensure the following is added to your .csproj as References:

<Reference Include="Xamarin.Android.Support.Design, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Xamarin.Android.Support.Design.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.Design.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v4, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Xamarin.Android.Support.v4.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.AppCompat, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.CardView, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Xamarin.Android.Support.v7.CardView.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="Xamarin.Android.Support.v7.MediaRouter, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <HintPath>..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.0.1.3\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll</HintPath>
  <Private>True</Private>
</Reference>

You can then remove the Resource.designer.cs file from your project, rebuild your project, and then re-add the Resource.designer.cs file to your project. It should generate the following Attribute items: https://gist.github.com/JonDouglas/7adf61469ce21663d7f536a4aa27c7df

Jon Douglas
  • 13,006
  • 4
  • 38
  • 51
  • removing the `Resource.designer.cs` allows the project (.droid) to compile. Re-adding it brings the errors back. Do I need that file? How can I re add it without the errors? – Gulzar Dec 28 '16 at 00:12