Xamarin 从一开始就形成许多错误

瓦西里希腊

在 VS 2017 中安装 Xamarin 并在 app.xaml.cs 中创建跨平台项目后,我有十个错误和九个警告(没有做任何事情)。我已经进行了搜索,我找到了将 xamarin 表单更新到最新版本的解决方案,但 xamarin 表单的最新版本为 2.5.0.28

我得到的错误和警告:

Severity    Code    Description Project File    Line    Suppression State
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\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  6   Active
Error   CS0246  The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)   App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  10  Active
Error   CS0115  'App.OnStart()': no suitable method found to override   App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  19  Active
Error   CS0115  'App.OnSleep()': no suitable method found to override   App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  24  Active
Error   CS0115  'App.OnResume()': no suitable method found to override  App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  29  Active
Error   CS0246  The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)   App1.iOS    C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  6   Active
Error   CS0103  The name 'InitializeComponent' does not exist in the current context    App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  14  Active
Error   CS0118  'MainPage' is a type but is used like a variable    App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  16  Active
Error       The type 'Application' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built. App1.iOS    C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml 2   
Error       The attachable property 'Resources' was not found in type 'Application'.    App1.iOS    C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml 5   
Warning     No resource found that matches the given name: attr 'windowNoTitle'.    App1.Android    C:\Users\vtsou_000\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.DarkActionBar'.  App1.Android    C:\Users\vtsou_000\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\vtsou_000\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  2   
Warning     No resource found that matches the given name: attr 'colorPrimary'. App1.Android    C:\Users\vtsou_000\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\vtsou_000\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  2   
Warning     No resource found that matches the given name: attr 'colorAccent'.  App1.Android    C:\Users\vtsou_000\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\vtsou_000\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  4   
Warning     No resource found that matches the given name: attr 'windowActionModeOverlay'.  App1.Android    C:\Users\vtsou_000\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  4   
Warning     Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'. App1.Android    C:\Users\vtsou_000\source\repos\App1\App1\App1.Android\Resources\values\styles.xml  4   

我是 Xamarin 的新开发人员,所以我不知道该怎么做。

重新启动 VS 2017 后,旧错误消失了,但我仍然收到新错误:

[I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_efe5e5bc\Android\AndroidSdkDirectory found:
    Path contains adb in \platform-tools (C:\Program Files (x86)\Android\android-sdk).
[I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_efe5e5bc\Android\AndroidNdkDirectory found:
    Path contains ndk-stack in \. (C:\ProgramData\Microsoft\AndroidNDK64\android-ndk-r13b).
[I:sdk]:                    Key HKCU\SOFTWARE\Xamarin\VisualStudio\15.0_efe5e5bc\Android\JavaSdkDirectory found:
    Path contains jarsigner.exe in \bin (C:\Program Files\Java\jdk1.8.0_131).
[I:]:                     Found Xamarin.Android 8.2.0.15
[I:]:                     Found Android SDK. API levels: 25, 26
[I:]:                     Found Xamarin.Android 8.2.0.15
[I:sdk]:                  Runtime path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android
[I:sdk]:                  Framework path: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0
[I:]:                     Tracking android devices started
[D:]:                     TrackDeviceTask got: 
[I:]:                     Got new device list from adb with 0 devices
[D:]:                     live player watcher: got device list from live player with 1 devices
[D:]:                     Tracking avd started
[D:]:                     avd watcher *.ini path: 'C:\Users\vtsou_000\.android\avd'
[D:]:                     avd watcher: got device list from avd with 5 devices
[E:]:                     an error occurred loading avd `Android_Accelerated_Nougat`, the system image does not exists
[E:]:                     an error occurred loading avd `Android_ARM_Nougat`, the system image does not exists
[E:]:                     an error occurred loading avd `Nexus_5_API_24`, the system image does not exists
[E:]:                     an error occurred loading avd `Nexus_5_API_25`, the system image does not exists

还有一个错误:

Severity    Code    Description Project File    Line    Suppression State
Error   CS0103  The name 'InitializeComponent' does not exist in the current context    App1.Android, App1.iOS  C:\Users\vtsou_000\source\repos\App1\App1\App1\App.xaml.cs  14  Active
瓦西里希腊

经过多次尝试,我想出了如何解决我的问题:

从 bin 和 obj 中删除文件是完全没有必要的,我的问题并没有消失。

我做的第一件事是构建解决方案。

第二种是从android卸载并重新加载解决方案。在此之后,我的代码中没有错误。

此外,sdk 工具设置不正确,模拟器无法正常工作。所以你必须安装它们。另一件事是在所有 xaml 文件上共享变量。右键单击属性并将内置操作设置为内容,然后再次设置为嵌入式资源。

正如我从一开始就说了太多错误。Microsoft 开发人员必须解决这些问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何从一开始就启动vim?

来自分类Dev

组织结构图从一开始就崩溃了

来自分类Dev

从一开始的Objective-C启动循环

来自分类Dev

枚举每个组中从一开始的行

来自分类Dev

数组从一开始就不为空

来自分类Dev

点击提交后,网站从一开始就刷新

来自分类Dev

从一开始的Objective-C启动循环

来自分类Dev

从一开始就存在安装问题

来自分类Dev

从一开始就阅读所有消息

来自分类Dev

为什么一开始的包络曲线是错误的?

来自分类Dev

将数据从一个活动发送到另一开始活动

来自分类Dev

Logstash一开始就崩溃

来自分类Dev

日历从星期一开始

来自分类Dev

Excel 2010区域图从一开始就下降

来自分类Dev

Java持久性:从一开始就考虑设计还是在以后添加?

来自分类Dev

如果从一开始就存在值,则ng-model不适用于输入

来自分类Dev

如何从一开始就使正则表达式匹配模式?

来自分类Dev

从一开始要在几行之内放置各种方向?

来自分类Dev

从一开始就发生ARM中断(Cortex-M4)

来自分类Dev

从一开始就查看具有RESTful API的Django网站的设计

来自分类Dev

从一开始就将免费购买的应用视为已购买

来自分类Dev

正则表达式从一开始就删除哈希

来自分类Dev

为什么scanf从一开始就要求输入?

来自分类Dev

如何从一开始就禁用条纹按钮,并在检查协议后将其启用?

来自分类Dev

如何从一开始就在tsql中重用游标

来自分类Dev

WKWebView从一开始就没有显示在NSViewRepresentable中

来自分类Dev

卡夫卡消费者从一开始就不消费

来自分类Dev

CAST总是从一开始就切断字符串吗?

来自分类Dev

我怎样才能让容器从一开始就变得健康

Related 相关文章

热门标签

归档