Errors when trying to start the android project

A few weeks ago I started a new Xamarin.Forms project and everything worked fine.
Now I wanted to continue working, but I always get the following errors when I try to build:

Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. App1.Droid D:\GitHub\App1\App1\App1.Droid\obj\Debug\resourcecache\49D36360DD564E3F3469C621394FA704\res\values-v23\values-v23.xml 6

Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. App1.Droid D:\GitHub\App1\App1\App1.Droid\obj\Debug\resourcecache\49D36360DD564E3F3469C621394FA704\res\values-v23\values-v23.xml 25

And this also happens in a completely new project! I just started to use Xamarin.Forms and Xamarin in general and would really appreciate your help.

Answers

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @KevinFrstl - I now have a blog post because these questions get asked so frequently: http://www.xamarinhelp.com/debugging-xamarin-android-build-and-deployment-failures/

    I would recommend deleting everything out of your Resources.Designer.cs file, then doing a rebuild. It will regenerate your Resources.Designer.cs file. I suspect that is your error but let me know if you continue to have issues after that.

  • KevinFrstlKevinFrstl DEMember

    It worked, now the build has no errors, but now I get the following exception when the app is starting:

    Unhandled Exception:
    Java.Lang.IllegalArgumentException: DrawerLayout must be measured with MeasureSpec.EXACTLY.

    Oddly enough the windows phone version starts without errors.

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    @AdamP I'm also having issues with Resource.Designer.cs. I updated to 2.2.0.23-pre4, kept deleting all file contents, and rebuilding. Nothing seems to fix this issue. I have Android support libraries 23.3.0. I noticed all of my issues are with the FFImageLoading package.

  • AdamPAdamP AUUniversity ✭✭✭✭✭

    @AdrianKnight - what errors are you having with that package, I had a quick look and can't see it relying on a particular XF version.

    @KevinFrstl - hey Kevin, apologies on missing the post, if you dont tag me in I don't receive any notification about replies. With you new error a quick google found this: https://forums.xamarin.com/discussion/22622/error-on-android-when-setpage-new-mymasterdetailpage-drawerlayout-must-be-measured-with

    Seems like it is most likely your issue

  • AdrianKnightAdrianKnight USMember ✭✭✭✭

    @AdamP @DanielL I have 151 errors. For that package, I'm using version 2.1.0-alpha1. All errors are of type "does not contain a definition for ___" Here are some of them:

    global::FFImageLoading.Forms.Droid.Resource.Attribute.mediaRouteSettingsDrawable = global::App26.Droid.Resource.Attribute.mediaRouteSettingsDrawable;
    
    global::FFImageLoading.Forms.Droid.Resource.Color.design_textinput_error_color = global::App26.Droid.Resource.Color.design_textinput_error_color;
    
    global::FFImageLoading.Forms.Droid.Resource.Dimension.design_fab_content_size = global::App26.Droid.Resource.Dimension.design_fab_content_size;
    
    global::FFImageLoading.Forms.Droid.Resource.Dimension.design_navigation_padding_top_default = global::App26.Droid.Resource.Dimension.design_navigation_padding_top_default;
    
    global::FFImageLoading.Forms.Droid.Resource.Dimension.design_tab_min_width = global::App26.Droid.Resource.Dimension.design_tab_min_width;
    

    These are undefined:

    mediaRouteSettingsDrawable
    design_textinput_error_color
    design_fab_content_size
    design_navigation_padding_top_default
    design_tab_min_width
    
  • DanielLDanielL PLInsider ✭✭✭✭

    @AdrianKnight New FFImageLoading 2.1.0-alpha2 nuget with Xamarin.Forms 2.2.0.31 support released.

Sign In or Register to comment.