简体   繁体   English

无法获取向导生成的Xamarin / Visual Studio 2017应用程序进行编译

[英]Can’t get wizard generated Xamarin / visual studio 2017 app to compile

I am trying to make my C++ application cross platform and port it from MFC. 我正在尝试使我的C ++应用程序跨平台并从MFC移植它。 The code base should be pretty portable but I am having problems getting something that works well. 该代码库应该是可移植的,但是我在获取某些可以正常工作的东西时遇到了问题。 Xamarin looks promising it seems like I could put my C++ code into a library and call it from C# code but so far I can't even get the most basic wizard created project to compile. Xamarin看起来很有前途,似乎我可以将C ++代码放入库中并从C#代码中调用它,但是到目前为止,我什至无法获得最基本的向导创建的项目来进行编译。 I am on a windows 7 machine. 我在Windows 7机器上。 I did a fresh install of visual studio 2017 community. 我重新安装了Visual Studio 2017社区。 I installed what I think are the correct components (see below) and had the wizard create a simple project. 我安装了我认为正确的组件(请参见下文),并让向导创建了一个简单的项目。 It then generates a long list of cryptic error messages. 然后,它会生成一长串隐秘的错误消息。 I am afraid I am not a C# programmer (if this looks promising I will have a reason to learn it). 恐怕我不是C#程序员(如果这看起来很有希望,我将有理由学习它)。 I have had some java android experience with android studio but never done NDK. 我在android studio上有一些Java android经验,但从未做过NDK。 So these are Greek to me and my web searches have not been fruitful. 所以这些对我来说是希腊文,我的网络搜索没有取得丰硕的成果。 Does anyone have any idea what these messages mean? 有谁知道这些消息的含义吗? In the wizard I made these choices: 1) Visual C# Android 2) Android app (Xamarain) 3) Single view app 4) Android 5.0 lolypop And I got these error messages, without adding a line of my own code: 在向导中,我做出了以下选择:1)Visual C#Android 2)Android应用(Xamarain)3)单视图应用4)Android 5.0 lolypop我得到了这些错误消息,而没有添加自己的代码行:

Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'Support' does not exist in the namespace 'Android' (are you missing an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 21 Active Error CS0234 The type or namespace name 'Support' does not exist in the namespace 'Android' (are you missing an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 5 Active Error CS0234 The type or namespace name 'Support' does not exist in the namespace 'Android' (are you missing an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 6 Active Error CS0246 The type or namespace name 'AppCompatActivity' could not be found (are you missing a using directive or an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 13 Active Error CS0115 'MainActivity.OnCreate(Bundle)': no suitable method found to override App1 C:\\Users\\Andre\\source\\repos\\App1\\App 严重性代码说明项目文件行抑制状态错误CS0234类型或名称空间名称'Support'在名称空间'Android'中不存在(您是否缺少程序集引用?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 21活动错误CS0234类型或名称空间名称'Support'在名称空间'Android'中不存在(您是否缺少程序集引用?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 5活动错误CS0234类型或名称空间名称'Support'在名称空间'Android'中不存在(您是否缺少程序集引用?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 6活动错误CS0246找不到类型或名称空间名称“ AppCompatActivity”(您是否缺少using指令或程序集引用?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity。 cs 13活动错误CS0115'MainActivity.OnCreate(Bundle)':找不到合适的方法来覆盖App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App 1\\MainActivity.cs 16 Active Error CS0115 'MainActivity.OnCreateOptionsMenu(IMenu)': no suitable method found to override App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 28 Active Error CS0115 'MainActivity.OnOptionsItemSelected(IMenuItem)': no suitable method found to override App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 34 Active Error CS0103 The name 'SetContentView' does not exist in the current context App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 19 Active Error CS0103 The name 'FindViewById' does not exist in the current context App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 21 Active Error CS0234 The type or namespace name 'Support' does not exist in the namespace 'Android' (are you missing an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 21 Active Error CS0103 The name 'SetSupportActionBar' does not exist in the current context App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 22 Active 1 \\ MainActivity.cs 16活动错误CS0115'MainActivity.OnCreateOptionsMenu(IMenu)':没有找到合适的方法来覆盖App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 28活动错误CS0115'MainActivity。 OnOptionsItemSelected(IMenuItem)':未找到合适的方法来覆盖App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 34活动错误CS0103名称'SetContentView'在当前上下文App1 C中不存在: \\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 19活动错误CS0103名称'FindViewById'在当前上下文App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity中不存在。 cs 21活动错误CS0234类型或名称空间名称'Support'在名称空间'Android'中不存在(您是否缺少程序集引用?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 21活动错误CS0103当前上下文App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs中不存在名称'SetSupportActionBar'22活动 Error CS0246 The type or namespace name 'FloatingActionButton' could not be found (are you missing a using directive or an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 24 Active Error CS0103 The name 'FindViewById' does not exist in the current context App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 24 Active Error CS0246 The type or namespace name 'FloatingActionButton' could not be found (are you missing a using directive or an assembly reference?) App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 24 Active Error CS0120 An object reference is required for the non-static field, method, or property 'MenuInflater.Inflate(int, IMenu)' App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 30 Active Error CS0103 The name 'Snackbar' does not exist in the current context App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\MainActivity.cs 48 Active Error CS0103 The name 'Snackbar' does not exist in the current context App1 C:\\Users\\Andre\\sou 错误CS0246找不到类型或名称空间名称'FloatingActionButton'(您是否缺少using指令或程序集引用?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 24活动错误CS0103名称'FindViewById'在当前上下文App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs中不存在24活动错误CS0246找不到类型或名称空间名称'FloatingActionButton'(您是缺少using指令或程序集引用吗?)App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 24活动错误CS0120非静态字段,方法或属性' MenuInflater.Inflate(int,IMenu)'App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 30活动错误CS0103名称'Snackbar'在当前上下文App1 C:\\ Users \\中不存在Andre \\ source \\ repos \\ App1 \\ App1 \\ MainActivity.cs 48活动错误CS0103名称'Snackbar'在当前上下文App1中不存在C:\\ Users \\ Andre \\ sou rce\\repos\\App1\\App1\\MainActivity.cs 48 Active Error NU1101 Unable to find package Xamarin.Android.Support.Design. rce \\ repos \\ App1 \\ App1 \\ MainActivity.cs 48活动错误NU1101无法找到软件包Xamarin.Android.Support.Design。 No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages App1 C:\\Users\\Andre\\source\\repos\\App1\\App1\\App1.csproj 1 源中不存在具有此ID的软件包:Microsoft Visual Studio脱机软件包App1 C:\\ Users \\ Andre \\ source \\ repos \\ App1 \\ App1 \\ App1.csproj 1

I had android NDK (R15C) selected as well as Apache Ant (1.9.3) and C++ Android development tools 我选择了android NDK(R15C)以及Apache Ant(1.9.3)和C ++ Android开发工具

I did not select the emulator as I want to use my phone at this point. 我目前未选择模拟器,因为我想使用手机。 I also left out the other NDK versions. 我还忽略了其他NDK版本。 Do these correspond to the android version eg 5.0 lolypop? 这些对应于Android版本,例如5.0 lolypop吗?

Thanks in advance. 提前致谢。

Last time, I upgraded VS & try test a xamarin app, I also faced this error. 上一次,我升级了VS并尝试测试xamarin应用程序,我也遇到了此错误。 I goto Tools -> NuGet Package Manager -> Package Manager Settings. 我转到工具-> NuGet软件包管理器->软件包管理器设置。 Check : Allow NuGet to download missing packages. 检查:允许NuGet下载缺少的软件包。 Check : Automatically check for missing packages during build in Visual Studio. 检查:在Visual Studio中构建期间自动检查丢失的软件包。 Then I rebuild app, NuGet check and download missing packages and build passed 然后我重新构建应用程序,NuGet检查并下载缺少的软件包并通过构建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在Visual Studio 2017上找不到跨平台应用程序Xamarin - I can't find cross platform app Xamarin on visual studio 2017 Visual Studio 2017 - 如何获取“新发布者向导” - Visual Studio 2017 - How to get the "New publisher Wizard" Visual Studio 2017将无法编译Xamarin跨平台项目 - Visual Studio 2017 will not compile xamarin cross platform project 如何在Visual Studio 2017中将Wikitude SDK与Xamarin组件一起使用来运行AR应用程序? - How to get a running AR app using Wikitude SDK with Xamarin Component in Visual studio 2017? 在Visual Studio 2017中的哪里可以找到“空白应用程序(Xamarin.Forms Portable)”? - Where in Visual Studio 2017 can I find “Blank App (Xamarin.Forms Portable)”? Visual Studio 2017 Xamarin无法安装nuget包MvvmCross.Plugin.DownloadCache插件 - Visual Studio 2017 Xamarin can't install nuget package MvvmCross.Plugin.DownloadCache plugin 无法使用Visual Studio 2015在Xamarin上创建应用 - Can't create an app on Xamarin with Visual Studio 2015 Visual Studio 2017预览-无法创建Xamarin.Forms应用程序 - Visual Studio 2017 Preview - Can not create a Xamarin.Forms Application Visual Studio 2017 Xamarin Android编译警告“fakeLogOpen(/ dev / log_security)失败”打破构建 - Visual Studio 2017 Xamarin Android compile warning “fakeLogOpen(/dev/log_security) failed” breaks build 无法编译Xamarin UWP应用 - Can't Compile Xamarin UWP App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM