【问题标题】:Uno platform: Android build fails with ShellTask errorUno 平台:Android 构建失败并出现 ShellTask​​ 错误
【发布时间】:2021-01-16 01:56:04
【问题描述】:

当我为 Android 构建时,我收到此错误:

Error The "ShellTask_v2ed6794b633a8ebf33d51d6d21f9d6a587ebe09e" 
task was not given a value for the required parameter
"TargetFramework".

查看构建输出,我看到它完成了构建UnoTest.dll,然后立即报告错误。在控制台输出中,还有更多信息:

C:\Users\...\.nuget\packages\uno.wasm.bootstrap\1.3.4\build\Uno.Wasm.Bootstrap.targets(126,2):
error MSB4044: ... (and then the same as above)

当我尝试进行 Android 构建时,它引用了与 Wasm 相关的内容,这似乎很奇怪。

构建完成,应用程序同时针对 UWP 和 Wasm 运行。而且,事实上,它在更早的时候就已经在 Android 上运行了。我开始添加一些 HttpClient 代码,这似乎与导致此错误有关。我把所有这些都注释掉了,但错误仍然存​​在。

有什么想法可以看吗?

编辑:

这后面跟着错误

CS1061 'MainPage' does not contain a definition for 'InitializeComponent' 
and no accessible extension method 'InitializeComponent' 
accepting a first argument of type 'MainPage' could be found

我已将左上角的下拉菜单设置为 UWP,以获取 c# 文件,然后重新启动 VS。这似乎没有帮助。

【问题讨论】:

    标签: android uno-platform


    【解决方案1】:

    如果您在非 WebAssembly 项目上安装 Uno.Wasm.Bootstrap,通常会发生这种情况。

    尝试从除MyProject.Wasm.csproj 之外的所有项目中卸载它。

    【讨论】:

    • 哇哦!有效。谢谢 !我不得不卸载并重新安装软件包,因为 nuget 一直失败。
    猜你喜欢
    • 2018-02-27
    • 2018-05-26
    • 1970-01-01
    • 1970-01-01
    • 2017-06-10
    • 2015-05-29
    • 1970-01-01
    • 2021-11-27
    • 2022-11-10
    相关资源
    最近更新 更多