Configuration
- Visual Studio 2022 17.8
- .NET 8.0
- Android SDK
Steps
- Create a new “Maui Blazor Hybrid Solution”
- Try building the solution
When you try building a Maui Blazor Hybrid Solution, in .NET 8, you might encounter a peculiar issue :
Cannot deploy the solution, please select deploy in the Configuration Manager
And if you click OK afterwards, you can see in the error list that it complains about a .ttf file. In my case OpenSans-Regular.ttf
After searching the web and interrogating Chatgpt and Microsoft Copilot like a Soviet counter intelligence agent, I finally figured it out.
Android doesn’t like “-” in names
The first step was to rename the font file by removing the “-” in the filename. That allowed me to move to the second level.
Correcting the file name got rid of the error in the error list but I got a bunch of them afterwards, which means in software development : you’re moving forward.
The subsequent errors were about splash screen and how Visual Studio couldn’t find the splash.svg.
If you look at the path it’s looking for, you can see that it contains your application name : com.companyname.whatevernameyourapplicationhas. I’m not entirely sure about this one but apparently, the whole package name can only be 50 characters so you need to change it in your android manifest.xml
Moving on to the boss because the last fix still doesn’t allow you to launch your app.
There’s an entry missing in your csproj. That is the most surprising of them all but here it is :
<MauiSplashScreen>
After you add this in your csproj… Tadaa it builds and launches your app.
Happy developing