Search code examples
androiduno-platform

Uno platform: Android build fails with ShellTask error


When I build for Android, I get this error:

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

Looking at the build output, I see that it completed building UnoTest.dll and then the error is reported immediately after. In the console output, there's a bit more info:

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)

It seems bizarre that it is referencing something related to Wasm when I'm trying to do an Android build.

The build completes and the app runs for both UWP and Wasm. And, in fact, it had been working for Android, earlier. I started adding some HttpClient code, which seemed to be related to causing this error. I commented out all of that, but the error persists.

Any ideas what to look at ?

EDIT:

This is followed by the error

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

I have let the upper-left dropdown to UWP, for a c# file, and restarted VS. That doesn't seem to help.


Solution

  • This generally happens if you install the Uno.Wasm.Bootstrap on a non-WebAssembly project.

    Try uninstalling it from all projects but MyProject.Wasm.csproj.