简体   繁体   English

Xamarin.Android 在 VS2019 中构建失败

[英]Xamarin.Android Build fails in VS2019

Hello StackOverflow Users,您好 StackOverflow 用户,

i have a Xamarin.Android project and i want to switch to VS2019 after being stuck on VS2015.我有一个 Xamarin.Android 项目,我想在卡在 VS2015 后切换到 VS2019。 However i can't build the project.但是我无法构建该项目。 Whenever i build the project, i get the following error:每当我构建项目时,我都会收到以下错误:

error: cannot find symbol
            String[] splitApks = applicationInfo.splitPublicSourceDirs;
  symbol:   variable splitPublicSourceDirs
  location: variable applicationInfo of type ApplicationInfo

I tried stuff like enabling packages specific to ABIs, switching the dex compiler, deleting the /bin and /obj directories but none of these changed anything.我尝试了启用特定于 ABI 的包、切换 dex 编译器、删除 /bin 和 /obj 目录等东西,但这些都没有改变任何东西。 I also looked up the message on Google, but i didn't find anything relevant.我还在 Google 上查找了该消息,但没有找到任何相关信息。

So i found a solution or rather a workaround myself.所以我自己找到了一个解决方案,或者说是一种解决方法。

I tried to change the target SDK and as it turned out this fixed my build.我试图更改目标 SDK,结果证明这修复了我的构建。 I couldn't build the app with the Android 4.4 SDK.我无法使用 Android 4.4 SDK 构建应用程序。 However i could build the app without a hitch with any other target SDK starting with Android 5.0.但是,我可以从 Android 5.0 开始与任何其他目标 SDK 一起构建应用程序。 You can set the target SDK in the Project Settings -> Application.您可以在 Project Settings -> Application 中设置目标 SDK。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM