Have an “'Resource.Attribute' does not con

2019-01-26 04:34发布

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()
        {
        }
    }

6条回答
干净又极端
2楼-- · 2019-01-26 04:52

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

查看更多
该账号已被封号
3楼-- · 2019-01-26 04:59

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
查看更多
来,给爷笑一个
4楼-- · 2019-01-26 05:03

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"

查看更多
萌系小妹纸
5楼-- · 2019-01-26 05:05

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
查看更多
做自己的国王
6楼-- · 2019-01-26 05:07

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.

查看更多
爷的心禁止访问
7楼-- · 2019-01-26 05:13

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.

查看更多
登录 后发表回答