16

Was trying to debug an empty app and got "'Resource.Attribute' does not contain a definition for 'actionBarSize'" error. I have reinstalled android SDK's.

    public static void UpdateIdValues()
    {
        global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::L1NQ.Droid.Resource.Attribute.actionBarSize;
    }
    public partial class Attribute
    {

        static Attribute()
        {
            global::Android.Runtime.ResourceIdManager.UpdateIdValues();
        }

        private Attribute()
        {
        }
    }
Ivan Zolotarov
  • 311
  • 1
  • 3
  • 16

5 Answers5

2

I had the same problem (and various more) after create a new .forms project (shared) with VS2015 Update 3 RC. To the JDK 7, I had installed the version:
Java SE Development Kit Update 55

After I have downloaded and installed
Java SE Development Kit Update 79

from: Download JDK 7 - Update 79

and rebooted my machine
this problem (an various further problems) has gone.

FredyWenger
  • 2,236
  • 2
  • 32
  • 36
  • Does it supports JDK 8 Update 40??? , B'coz I have 8 Update 40, still getting the same error. – Nirav Madariya Jul 06 '16 at 11:37
  • I don't know - in my case, I was able to resolve the problem with exactly the version, I wrote above... – FredyWenger Jul 06 '16 at 13:55
  • @NiravMadariya "It is essential to install the 32-bit version of the Java JDK even if you're using 64-bit Windows. It is also important that v1.7 of the Java JDK is installed (although it is fine to have 1.8 or newer installed at the same time)." https://developer.xamarin.com/guides/android/getting_started/installation/windows/manual_installation/#Installing_Java_SDK_(JDK) – lucas.mdo Nov 11 '16 at 11:47
2

This error can have also 2 other reasons.

  1. If any of your images named contains "-" (dash) in android project.
  2. if you are using xlab, latest stable xlab version is not compatible with latest XF version. you find more details and solution here. It is suggested to use XLabs.Forms 2.2.0-pre05
Emil
  • 6,411
  • 7
  • 62
  • 112
  • 2
    TO ANYONE NOW VIEWING THIS PAGE: This answer, which was not applicable when the question was asked, solved my issues. The latest stable builds of Xlabs and Xamarin.Forms were incompatible (as of 11/1/16). Once I updated to XLabs.Forms 2.2.0-pre05 through the NuGet Package Manager (there is a checkbox to show available prerelease builds), my elusive problem was solved. I had been stuck for days, so this seems like a HUGE BUG to me. Idk how this is the first I've read about it. I'm shocked that Xlabs has not updated the stable version yet. This needs more upvotes! Thanks a lot @batmaci ! – jnel899 Nov 01 '16 at 10:06
0

Remove all files at C:\Users{your username}\AppData\Local\Xamarin and rebuild your project.

Renzo Robles
  • 684
  • 6
  • 10
0

This worked for me:

  • Removed all Xamarin Google Play Services nuget packages.
  • Reinstall those packages which i need.

Once i tried to install packages again nuguet asked me to change Compile API to level 24.

0

Check all your axml twice in my case i write android:src="@drawable/ic_action_content_new" this line in my axml file but in my drawable there is no file whose name id "ic_action_content_new"

vebs
  • 325
  • 1
  • 4
  • 11