none
Unable to get a clean build after installing Xamarin

    Question

  • I followed all of the guidance in "setting up VS for Xamarin", and "Verifying Xamarin", but when I create a blank app it won't compile for either UWP or Android (not using IOS).  The problem seems to be something missing  in styles.xml. For both UWP and Android targets, I get "Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. in ...\App1.Android\Resources\values\styles.xml, and a host of related problems.  These are build errors "right out of the box", i.e. I have made NO modifications from the VS-generated templates.  I am obviously doing something stupid, but can't figure it out.

    P.S. - VS2017 Community Edition, Windows 10 Pro

    • Edited by tlj3071a Tuesday, February 06, 2018 11:17 PM
    Tuesday, February 06, 2018 11:14 PM

All replies

  • Hi friend,

    It's probably related to JDK version, maybe Change to latest JDK version will help.

    This thread with similar issue gave the solution, please refer to:

    https://stackoverflow.com/a/42402252/9125096

     

    Regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Wednesday, February 07, 2018 8:15 AM
  • Nope.  JDK was already set to JDK 1.8 ("C:\Program Files (x86)\Java\jdk1.8.0_161").  Also, apparently Windows10 keeps things somewhere else.  There was no zips folder in C:\Users\<User>\AppData\Local\Xamarin, there were no packages, or .Droid folders in the project, and as far as I could tell, there was nothing downloaded prior to or during the first build - which still failed identically.
    Wednesday, February 07, 2018 4:22 PM
  • I wonder which guidance you've referred, as all of Xamarin is included with all editions of Visual Studio 2017, which mean we don't need some extra particular setting VS for Xamarin. 

    https://docs.microsoft.com/en-us/visualstudio/cross-platform/setup-and-install 

    If it's caused by the issue that happened during the installing, you may try to repair VS and see.  

     

    Regards, 

    Fletcher 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, February 08, 2018 2:38 AM
  • Yes, that is the article to which I was referring. Not sure what you mean by "repair VS", although I'm game to try almost anything at this point.  I've thought of completely removing and re-installing VS, but due to not having a good high-speed connection, I'm leaving that till I've exhausted everything else.
    Thursday, February 08, 2018 2:29 PM
  • Okay, I hope reinstalling could work. 

    Repair is another choice:

    Launch Visual Studio Installer:

     

    Regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, February 09, 2018 1:52 AM
  • Well, that didn't work either.  At this point I think my only option is to completely de-install and re-install VS.  Thanks for the help,

    Tom

    Friday, February 09, 2018 4:37 PM
  • Status: 

    1) Completely de-installed VS using Settings::Apps.
    2) Manually removed ".android" directory from c:\Users\<User>\
    3) Completely re-installed VS 2017 Community
    4) Changed default project directory to "D:\repos"
    5) Selected new "Cross-Platform App (Xamarin Forms)" from VS Start page
    6) Selected "Android|Windows (UWP)":"Blank App":"Xamarin Forms":"Shared Project" from Select Template dialog then, doing NOTHING else,  got the following errors:

    Description Project File
    3: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    3: error: Error: No resource found that matches the given name: attr 'colorAccent'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    1: error: Error: No resource found that matches the given name: attr 'windowActionBar'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    2: error: Error: No resource found that matches the given name: attr 'colorAccent'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    3: error: Error: No resource found that matches the given name: attr 'windowActionModeOverlay'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    1: error: Error: No resource found that matches the given name: attr 'windowNoTitle'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    1: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    1: error: Error: No resource found that matches the given name: attr 'colorPrimary'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml
    1: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. App1.Android D:\repos\App1\App1\App1.Android\Resources\values\styles.xml

    Saturday, February 10, 2018 3:14 PM
  • I feel so sorry about this issue still persists.

    I found this thread with similar issue which caused by the support library version error:

    https://github.com/auth0/Lock.Android/issues/390

     

    Regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, February 12, 2018 9:41 AM
  • You already tried a Build->Build Solution?
    Immediately after creating new Xamarin.Forms project I get output:

    But looks like these warnings do not affect a successful build.
    After building, these warnings are gone.

    With kind regards
    Monday, February 12, 2018 11:39 AM