Open randmaayan opened 2 days ago
We will need a .binlog to investigate this further. Can you add -bl
to the command and attach the resuting binlog (you will need to zip it first).
It's the same behavior here.
I've seen people putting proguard.cfg in Platforms\Android\ folder but this also doesn't work in my project. Even if I add this configuration to .csproj:
<ProguardConfiguration Include="Platforms\Android\proguard.cfg" />
Android projects have will these wildcards by default, so you just have to name a file to match these patterns:
Unfortunately, MAUI overrides Android wildcards with their own:
So, you will have to put <ItemGroup><ProguardConfiguration Include="..." />
for the file in a .NET MAUI project. If this doesn't work, we'll need a .binlog
to investigate further.
Looks weird but after changing:
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
to this (and fixing everything related)
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
it's working now.
Looks weird but after changing:
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
to this (and fixing everything related)<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
it's working now.
$(TargetFramework)
is never expanded to include the 34.0 unless you list that yourself in $(TargetFrameworks)
with an s
. You can probably find that value in $(TargetPlatformVersion)
, but this is only set after your .csproj
file or at the time <ItemGroup>
are evaluated.
@randmaayan did adding <ProguardConfiguration Include="..." />
solve your issue? If so, we should move this to dotnet/maui, so they can fix up their default wildcards.
Trying to set the Android target SDK in the .csproj doesn't work for me. However, setting it in the Android manifest does. <ProguardConfiguration Include="..." />
works for me.
Hi @randmaayan. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Android framework version
net9.0-android
Affected platform version
.net9
Description
When trying to build the app in release mode with the following configs, the proguard rules created ignore my rules in the proguard.cfg file. Is there something I would need to configure in VSCode? (I'm looking at the obj/Release/net9.0-android/proguard/proguard_project_primary.cfg created)
Steps to Reproduce
Did you find any workaround?
No response
Relevant log output