更新时间:2023-02-26 21:06:13
您可以参考: https://forums.xamarin.com/讨论/ 59017 /无资源发现 - 即百搭的给出的名称管理主题程序兼容性光
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
You could refer to this: https://forums.xamarin.com/discussion/59017/no-resource-found-that-matches-the-given-name-theme-appcompat-light