maui: The project doesn't know how to run the profile with name 'DEVICE NAME' and command 'Mobile'

maui: The project doesn't know how to run the profile with name 'DEVICE NAME' and command 'Mobile'

Deploying to Android using VS2022 / Maui, and getting message box saying:

"The project doesn't know how to run the profile with name 'Motorola moto g stylus 5G - 2023 (Android 14.0 - API 34)' and command 'Mobile'."

Answer

Source of Read more.

The occurs with using multiple TargetFrameworks in the Maui csproj.

For example:

<TargetFrameworks>net9.0;net9.0-android35.0</TargetFrameworks>

It appears the 'android' framework needs to be first in a maui csproj.

So changing it to:

<TargetFrameworks>net9.0-android35.0;net9.0</TargetFrameworks>

Fixes the problem.

(Restarting VS2022 after making these changes might also be necessary)

Enjoyed this article?

Check out more content on our blog or follow us on social media.

Browse more articles