What should be the alternate file BuildAction when migrating from Xamarin to .NET MAUI?

dg2k 1,401 Reputation points
2023-08-10T13:22:42.5533333+00:00

I have Android files with BuildAction of GoogleServicesJson and ProguardConfiguration under Xamarin. When migrating to .NET MAUI, these build actions are not available.

What are the the alternate GoogleServicesJson and ProguardConfiguration BuildActions under .NET MAUI?

  • Content?
  • Embedded resource?
  • None?

Help, please.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,065 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Graham McKechnie 441 Reputation points
    2023-08-10T20:36:38.6966667+00:00

    My app is not Maui. It is an Android net7 app though and I have both those files in my project. When you click on properties Build Action they read GoogleServicesJson and ProguardConfiguration respectively.

    How did you add them to the project? From solution explorer I used add/existing item and went to the old Xamarin.Android project and picked each one from there. That created a new ItemGroup in csproj file.

    <ItemGroup>
    	<GoogleServicesJson Include="google-services.json" />
    </ItemGroup>
    

    I would assume for Maui you'd do something similar. It is interesting though I don't have an ItemGroup for the the proguard.cfg which I'd never noticed before. I know it is working though because each release build produces new seeds, usage and mapping files - thats the first thing (change) you notice in git changes when you rebuild a release build. Typical idiot mistake I tend to make, not changing the build number when about to upload the aab to Google Play. Think I'm done then look around and see the big note on the wall - "Change the build number, dickhead"

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.