如何使用Xamarin Visual Studio 2015构建Android App Bundle?

3
我发现Google Play不再允许apk格式的应用程序,而是要求使用Android App Bundle格式。

这篇文章说:

To enable support for Android App Bundles, you’ll need to opt-in to the bundle value of the Android Package Format property within your Android options. As you do this, ensure you change your project to a Release configuration as app bundles are intended for release packages only. To do this you can follow these steps:

1. Right click your project, and select Properties.
2. Navigate to Android Options.
3. Change your configuration to Release.
4. Change the Android Package Format to bundle.

Android Package Format image

但我在我的 Visual Studio 2015 的 Android 选项中找不到该选项。 VS 2015 Android Options image

我想坚持使用 Visual Studio 2015,因为我没有时间升级 (升级旧硬件上的软件可能会导致卡顿,我可能需要购买一个新的笔记本电脑,这是我真的不想要的)。是否有办法可以使用 Visual Studio 2015 (或来自 Google 的工具) 构建 Android 应用程序包?还是我必须在 Windows 上安装 Visual Studio 16.4 或更高版本?


2
VS2015在2020年结束了其支持周期。 - undefined
@Jason: 但是有没有其他办法?也许可以通过命令行或其他方式解决。我查看了这篇文章:https://learn.microsoft.com/en-us/xamarin/android/release-notes/9/9.4#initial-support-for-android-app-bundle-publishing-format,但是我的.csproj文件中没有`<AndroidPackageFormat>`标签。 - undefined
2
我有点怀疑。Xamarin很久以前就不支持VS2015了,所以最新的Android SDK和工具将无法与其兼容。 - undefined
能帮到你吗? - undefined
@LeoZhu-MSFT - 我决定升级到VS2019,花了我一天的时间来升级,但是省了我很多麻烦。VS2015对于开发移动应用来说太过疲惫了。 - undefined
@LeoZhu-MSFT - 我不知道哪个解决方案更好,是继续使用变通方法(从 AppCenter 创建应用程序包-> 尚未测试,无法确认其是否有效),还是升级(升级是为了避免麻烦的建议,但如果硬件太弱不能升级,或者没有 VS2019 许可证,则升级解决方案就无法使用)。所以我将把决定交给投票者,得票最多的答案将排在首位。 - undefined
3个回答

8

对于Visual Studio 2019,进入Xamarin.Android项目的属性。在“Android选项”侧边菜单下,选择“绑定”作为“Android程序包格式”。

在此输入图片描述


2
我认为你无法在Visual Studio 2015中完成这个操作,因为这个功能是在Visual Studio 2019的16.4版本中添加的。你可以查看发行说明链接以获取更多信息。

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接