-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using a custom configuration to publish Android app #9627
Comments
Update: I managed to force the aab format using |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
This file has all the settings for Release mode: I think you'd want these to match <PropertyGroup Condition=" '$(Configuration)' == 'FooRelease' ">
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidPackageFormats>aab;apk</AndroidPackageFormats>
<PublishTrimmed>true</PublishTrimmed>
<RunAOTCompilation>true</RunAOTCompilation>
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
</PropertyGroup> There was some talk about making MSBuild have a way to "inherit" configurations to make this easier, but I don't know when/if that feature will come. |
thank you! can you please share the same for the debug? |
Debug you could probably leave blank. But to get hot reload you would need: <PropertyGroup Condition=" '$(Configuration)' == 'FooDebug' ">
<UseInterpreter>true</UseInterpreter>
</PropertyGroup> |
Is there anything similar for iOS? |
@rolfbjarne could maybe comment about the default values for iOS. As-is, I don't see anything we can do here outside of some general solution for .NET and MSBuild. Basically we need a way to "inherit" / "extend" configurations, and it seems like something we'd need a general design for. Closing for now as it isn't something we can really address in .NET MAUI, thanks! |
We don't have anything centralized like Android does, but these are the options that change depending on the configuration:
|
Description
I'm using a custom defined configuration in the csproj (so no standard Debug/Release but something like "Company Release/Debug Production/Staging" and, when the config is a Debug/Release one I define the following properties

and of course I defined DEBUG and RELEASE in DefineConstants. But when I publish using this configuration for android using
dotnet publish -f:net6.0-android -c "Custom Configuration"
I have no assembly optimization step and it doesn't publish the aab, only apk (even tough I have the android key store properties only when I'm in release and android)Is there anything missing to fully support anything the default Debug/Release configurations do when building and publishing?
Steps to Reproduce
Version with bug
6.0.486 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
All versions
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: