Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have an "'Resource.Attribute' does not contain a definition for 'actionBarSize'" error

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()
        {
        }
    }
like image 967
Ivan Zolotarov Avatar asked May 15 '16 13:05

Ivan Zolotarov


3 Answers

These actions helped:

  1. Delete Bin and Obj folders in project folder
  2. Delete contents of C:\Users{your username}\AppData\Local\Xamarin\zips
  3. Rebuild project
like image 152
Ivan Zolotarov Avatar answered Nov 18 '22 10:11

Ivan Zolotarov


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.

like image 38
FredyWenger Avatar answered Nov 18 '22 11:11

FredyWenger


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
like image 32
Emil Avatar answered Nov 18 '22 10:11

Emil