创建空白Xamarin.Forms应用程序时出错。 [英] Errors when creating blank Xamarin.Forms app.
问题描述
我在创建xamarin项目时遇到了麻烦。当我这样做时,Vs显示了很多错误。即使我仍然可以运行应用程序,我认为将它们放在一个空白项目中是不正常的。我试图修复vs并重新安装软件包,但没有任何改变。
有人能帮帮我吗?以下是完整的错误列表。
错误   CS0115   'MainActivity.OnCreate(Bundle)':找不到合适的方法来覆盖   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs     15  
有效
警告     检索项目的父项时出错:找不到与给定名称"Theme.AppCompat.Light.DarkActionBar"匹配的资源。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  
2
警告     检索项目的父项时出错:找不到与给定名称"Theme.AppCompat.Light.Dialog"匹配的资源。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  
4
警告     找不到与给定名称匹配的资源:attr'colorAccent'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml     3  
警告     找不到与给定名称匹配的资源:attr'colorAccent'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml     4  
警告     找不到与给定名称匹配的资源:attr'colorPrimary'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml     2  
警告     找不到与给定名称匹配的资源:attr'colorPrimaryDark'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  
2
警告     找不到与给定名称匹配的资源:attr'windowActionBar'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  
2
警告     找不到与给定名称匹配的资源:attr'windowActionModeOverlay'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  
4
警告     找不到与给定名称匹配的资源:attr'windowNoTitle'。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\Resources\values\styles.xml     2  
错误   CS0103   当前上下文中不存在名称"InitializeComponent"   App1.Android     C:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml.cs     14  
有效
错误   CS0103   当前上下文中不存在名称"LoadApplication"   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs     23  
有效
错误   CS0103   当前上下文中不存在"TabLayoutResource"名称   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs     17  
有效
错误   CS0103   当前上下文中不存在名称"ToolbarResource"   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs     18  
有效
错误     找不到"ContentPage"类型。验证您是否缺少程序集引用,并且已构建所有引用的程序集。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml  
2
错误     找不到"标签"类型。验证您是否缺少程序集引用,并且已构建所有引用的程序集。   App1.Android     C:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml  
7
错误   CS0246   找不到类型或命名空间名称'ContentPage'(您是否缺少using指令或程序集引用?)   App1.Android     C:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml.cs  
10 有效
错误   CS0234   名称空间'Xamarin'中不存在类型或命名空间名称'Forms'(您是否缺少程序集引用?)   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs  
13 有效
错误   CS0234   名称空间'Xamarin'中不存在类型或命名空间名称'Forms'(您是否缺少程序集引用?)   App1.Android     C:\users\mihail\source\repos\App1\App1\App1\MainPage.xaml.cs  
6 有效
错误   CS0234   名称空间'Xamarin'中不存在类型或命名空间名称'Forms'(您是否缺少程序集引用?)   App1.Android     C:\users\mihail\source\repos\App1\App1\App1.Android\MainActivity.cs  
22 有效
您可以参考: 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
这篇关于创建空白Xamarin.Forms应用程序时出错。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!