Asked by:
Errors when creating blank Xamarin.Forms app.

Question
-
Hi, I have a trouble with creating xamarin project. When I do this, Vs shows a lot of errors. Even though I still can run the app, I don't think this is normal to have them in a blank project. I tried to repair vs and reinstall packages, but nothing changed. Can someone help me? Here's the full list of errors.
Error CS0115 'MainActivity.OnCreate(Bundle)': no suitable method found to override App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs 15 Active
Warning Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 2
Warning Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 4
Warning No resource found that matches the given name: attr 'colorAccent'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 3
Warning No resource found that matches the given name: attr 'colorAccent'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 4
Warning No resource found that matches the given name: attr 'colorPrimary'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 2
Warning No resource found that matches the given name: attr 'colorPrimaryDark'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 2
Warning No resource found that matches the given name: attr 'windowActionBar'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 2
Warning No resource found that matches the given name: attr 'windowActionModeOverlay'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 4
Warning No resource found that matches the given name: attr 'windowNoTitle'. App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml 2
Error CS0103 The name 'InitializeComponent' does not exist in the current context App1.Android c:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml.cs 14 Active
Error CS0103 The name 'LoadApplication' does not exist in the current context App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs 23 Active
Error CS0103 The name 'TabLayoutResource' does not exist in the current context App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs 17 Active
Error CS0103 The name 'ToolbarResource' does not exist in the current context App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs 18 Active
Error The type 'ContentPage' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. App1.Android c:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml 2
Error The type 'Label' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. App1.Android c:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml 7
Error CS0246 The type or namespace name 'ContentPage' could not be found (are you missing a using directive or an assembly reference?) App1.Android c:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml.cs 10 Active
Error CS0234 The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?) App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs 13 Active
Error CS0234 The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?) App1.Android c:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml.cs 6 Active
Error CS0234 The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?) App1.Android c:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs 22 Active
- Moved by Sara LiuMicrosoft contingent staff Tuesday, March 20, 2018 6:26 AM
Thursday, March 15, 2018 6:56 AM
All replies
-
You could refer to this: https://forums.xamarin.com/discussion/59017/no-resource-found-that-matches-the-given-name-theme-appcompat-lightFriday, March 16, 2018 4:22 AM
-
Hi MihailShabunin,
Welcome to the MSDN forum.
What version of Visual Studio do you use?
What’s the type of Xamarin.Forms project do you use?
I create a blank Cross-Platform App (Xamarin.Forms) project with Android use Visual Studio Enterprise 2017 version 15.6.1, it works fine in my side.
You could clear the cache of Xamarin.Droid package.
In my experience, Xamarin.Droid packages might be the one that caused this error. So, you are free to remove them. After removal those folders, please try to rebuild the project to restore it back. Go to the following path in your machine: Windows C:\Users\username\AppData\Local\Xamarin MacOS /Users/username/.local/share/Xamarin.
And, please take a look at the thread that York Shen provided, try it and test again.
In addition, if you want to know more information, I suggest you go to Stack Overflow or Xamarin forum to get a professional answer.
Regards,
Judyzh
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, March 16, 2018 5:10 AM