“Resource” contains no Definition for “Animation”

女生的网名这么多〃 提交于 2019-12-19 18:24:49

问题


So i'm currently in the process of evaluating trials of Xamarin.Forms and UI for XamarinForms from telerik.

Unfortunately once i link the libraries to the telerik dll's i'm getting a messed up Resource.Designer.cs file.

I'm getting 5000 errors of "Resource" contains no Definition for "Animation". (also Resource.Drawable, Resource.Style, Styleable,...) from code like this:

    public static void UpdateIdValues()
    {
        global::Telerik.XamarinForms.ChartRenderer.Android.Resource.Animation.abc_fade_in = global::MyNamespace.XamarinForms.Droid.Resource.Animation.abc_f
        global::Telerik.XamarinForms.ChartRenderer.Android.Resource.Animation.abc_fade_out = global::MyNamespace.XamarinForms.Droid.Resource.Animation.abc_fade_out;
        ....

Does that ring a bell to anyone?

Already started a ticket on telerik but i guess someone else may run into the same issue and might need a fix.


回答1:


if

Resources\Resource.designer.cs(29,110): error CS0117: '.........' does not contain a definition
 for 'Animation' [C:\......Droid.csproj]

*5000

Looks familiar Im not sure its a Telerik issue. Just updated a project from forms Library 1.5.0.6447 to 1.5.1.6468 and got a stck of them. Could be we'll have to wait on a Xamarin.Forms Fix.

EDIT Finally found the answer and if you haven't as well I'm guessing its the same. Open up your Android SDK manager and Install the Android 6.0 (API 23). If that doesn't work Heck just install everything. The dependency stack with Android appears to be a little messy. Either Telerik or Xamarin.Forms likely has a dependency on a specific Android SDK that you don't have installed.

Update on this one: Time moves on and this error seems to be a catchall for a variety of issues. Had the same problem recently and Removing all of the Xamarin Nuget packages and re adding them to the project fixed it. Thought it might be worth adding as another possible solution. Other things that have fixed this for me in the past. - Rebooting - Restarting the IDE - Cleaning and Recompiling the App. I didn't mention those earlier as I assume if your here you've already tried that :D




回答2:


'Resource.Animation' does not contain a definition for projectName

'Resource.String'does not contain a definition for projectName

'Resource.*' if you messed up Resource.Designer.cs file, just deleting the Resource.Designer.cs file and doing a clean and rebuild that did the trick.

Steps:

  1. Delete the Resource.Designer.cs
  2. Clean the project
  3. Rebuild the project



回答3:


If you have project a referencing project b, and using a Xamarin package (in my case appcompat) in project b, then make sure that the package is also referenced in project a.



来源:https://stackoverflow.com/questions/33219973/resource-contains-no-definition-for-animation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!