Uno 平台:Android 构建失败并出现 ShellTask 错误
Uno platform: Android build fails with ShellTask error
当我为 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.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。这似乎没有帮助。
如果您在非 WebAssembly 项目上安装 Uno.Wasm.Bootstrap
,通常会发生这种情况。
尝试从所有项目中卸载它,但 MyProject.Wasm.csproj
。
当我为 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.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。这似乎没有帮助。
如果您在非 WebAssembly 项目上安装 Uno.Wasm.Bootstrap
,通常会发生这种情况。
尝试从所有项目中卸载它,但 MyProject.Wasm.csproj
。