{"id":356,"date":"2024-05-09T08:00:00","date_gmt":"2024-05-09T06:00:00","guid":{"rendered":"https:\/\/archicode.be\/?p=356"},"modified":"2024-05-08T14:00:48","modified_gmt":"2024-05-08T12:00:48","slug":"weird-issues-with-maui-blazor-hybrid-app","status":"publish","type":"post","link":"https:\/\/archicode.be\/index.php\/2024\/05\/09\/weird-issues-with-maui-blazor-hybrid-app\/","title":{"rendered":"Weird issues with Maui Blazor Hybrid app"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuration<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Visual Studio 2022 17.8<\/li>\n\n\n\n<li>.NET 8.0<\/li>\n\n\n\n<li>Android SDK<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Steps<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a new &#8220;Maui Blazor Hybrid Solution&#8221;<\/li>\n\n\n\n<li>Try building the solution<\/li>\n<\/ul>\n\n\n\n<p>When you try building a Maui Blazor Hybrid Solution, in .NET 8, you might encounter a peculiar issue :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Cannot deploy the solution, please select deploy in the Configuration Manager<\/p>\n<\/blockquote>\n\n\n\n<p>And if you click OK afterwards, you can see in the error list that it complains about a .ttf file.  In my case <em>OpenSans-Regular.ttf<\/em><\/p>\n\n\n\n<p>After searching the web and interrogating Chatgpt and Microsoft Copilot like a Soviet counter intelligence agent, I finally figured it out.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Android doesn&#8217;t like &#8220;-&#8221; in names<\/h2>\n\n\n\n<p>The first step was to rename the font file by removing the &#8220;-&#8221; in the filename.  That allowed me to move to the second level.<\/p>\n\n\n\n<p>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&#8217;re moving forward.<\/p>\n\n\n\n<p>The subsequent errors were about splash screen and how Visual Studio couldn&#8217;t find the splash.svg. <\/p>\n\n\n\n<p>If you look at the path it&#8217;s looking for, you can see that it contains your application name : com.companyname.whatevernameyourapplicationhas.  I&#8217;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<\/p>\n\n\n\n<p>Moving on to the boss because the last fix still doesn&#8217;t allow you to launch your app.<\/p>\n\n\n\n<p>There&#8217;s an entry missing in your csproj.  That is the most surprising of them all but here it is :<\/p>\n\n\n\n<p>&lt;MauiSplashScreen><\/p>\n\n\n\n<p>After you add this in your csproj&#8230; Tadaa it builds and launches your app.<\/p>\n\n\n\n<p><em>Happy developing <\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configuration Steps 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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[1],"tags":[],"class_list":["post-356","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":368,"url":"https:\/\/archicode.be\/index.php\/2024\/05\/12\/error-netsdk1082-in-maui-blazor-hybrid-app\/","url_meta":{"origin":356,"position":0},"title":"Error NETSDK1082 in Maui Blazor Hybrid App","author":"Hakim","date":"May 12, 2024","format":false,"excerpt":"There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'android-x64' If you ever encountered this error in your Maui Blazor hybrid App, this is probably due to authentication.It took me a while to find it out (more than I care to admit) mainly because I had serial\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/archicode.be\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":92,"url":"https:\/\/archicode.be\/index.php\/2019\/06\/10\/how-to-blazorify-an-existing-mvc-app\/","url_meta":{"origin":356,"position":1},"title":"How to blazorify an existing mvc app","author":"Hakim","date":"June 10, 2019","format":false,"excerpt":"Blazor is awesome. \u00a0If you don't know what it is, you can check it out here\u00a0but to summarize, it's a framework that allows .net code to run in your browser using the power of Web Assembly. I've found a lot of tutorials using the official blazor templates but only hints\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/archicode.be\/index.php\/category\/net\/"},"img":{"alt_text":"migrate_solution_to_dotnet_core_3.gif","src":"\/wp-content\/uploads\/2019\/06\/migrate_solution_to_dotnet_core_3.gif","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2019\/06\/migrate_solution_to_dotnet_core_3.gif 1x, \/wp-content\/uploads\/2019\/06\/migrate_solution_to_dotnet_core_3.gif 1.5x, \/wp-content\/uploads\/2019\/06\/migrate_solution_to_dotnet_core_3.gif 2x, \/wp-content\/uploads\/2019\/06\/migrate_solution_to_dotnet_core_3.gif 3x, \/wp-content\/uploads\/2019\/06\/migrate_solution_to_dotnet_core_3.gif 4x"},"classes":[]},{"id":324,"url":"https:\/\/archicode.be\/index.php\/2023\/11\/07\/how-to-use-feature-flags-in-blazor\/","url_meta":{"origin":356,"position":2},"title":"How to use Feature Flags in Blazor","author":"Hakim","date":"November 7, 2023","format":false,"excerpt":"Feature flags are a way of controlling the availability and behavior of features in your application without changing the code. They can help you with testing, experimentation, and gradual rollout of new functionality. Blazor is a framework for building interactive web UIs using C# and .NET. In this blog post,\u2026","rel":"","context":"Similar post","block_context":{"text":"Similar post","link":""},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/archicode.be\/wp-content\/uploads\/2023\/11\/4b6f8d86-a588-4313-8cc9-4c41a90aaae5.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/archicode.be\/wp-content\/uploads\/2023\/11\/4b6f8d86-a588-4313-8cc9-4c41a90aaae5.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/archicode.be\/wp-content\/uploads\/2023\/11\/4b6f8d86-a588-4313-8cc9-4c41a90aaae5.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/archicode.be\/wp-content\/uploads\/2023\/11\/4b6f8d86-a588-4313-8cc9-4c41a90aaae5.jpeg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":162,"url":"https:\/\/archicode.be\/index.php\/2020\/06\/30\/blazor-server-side-or-web-assembly\/","url_meta":{"origin":356,"position":3},"title":"Blazor : server-side or Web assembly","author":"Hakim","date":"June 30, 2020","format":false,"excerpt":"Blazor is amazing. But if you are wondering which of Web Assembly of Server-Side would suit your project, here's an attempt to explain and help","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/archicode.be\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":366,"url":"https:\/\/archicode.be\/index.php\/2024\/05\/11\/understanding-inject-in-blazor-components\/","url_meta":{"origin":356,"position":4},"title":"Understanding @inject in Blazor Components","author":"Hakim","date":"May 11, 2024","format":false,"excerpt":"Blazor, Microsoft\u2019s framework for building interactive client-side web UI with .NET, offers a robust solution for dependency injection (DI) in the form of the\u00a0@inject\u00a0directive. This powerful feature allows developers to inject services directly into their components, promoting a clean and modular architecture. What is Dependency Injection? Dependency Injection (DI) is\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/archicode.be\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":163,"url":"https:\/\/archicode.be\/index.php\/2020\/07\/07\/blazor-convince-your-architect\/","url_meta":{"origin":356,"position":5},"title":"Blazor : convince your CTO (or whomever takes the technical decisions)","author":"Hakim","date":"July 7, 2020","format":false,"excerpt":"When there is something new on the market, we developers want to work with it. There might be several reasons for that, but not always the shortcut decision makers think we favour, which is wanting to try the new shiny thing. Most of the time, we want to work with\u2026","rel":"","context":"In &quot;.NET&quot;","block_context":{"text":".NET","link":"https:\/\/archicode.be\/index.php\/category\/net\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":1,"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/posts\/356\/revisions\/357"}],"wp:attachment":[{"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/archicode.be\/index.php\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}