xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.46k stars 511 forks source link

Mac Catalyst MAUI build Application Name appearing as Assembly Name - Causing Apple Rejection #21478

Open PureWeen opened 5 days ago

PureWeen commented 5 days ago

Issue moved from dotnet/maui#25364


From @caliberdigitalllc on Friday, October 18, 2024 2:07:31 AM

Description

I am producing a Mac Catalyst build for release with the following command:

dotnet publish -f net9.0-maccatalyst -c Release \
    -p:ArchiveOnBuild=true \
    -p:CreatePackage=true \
    -p:EnableCodeSigning=true \
    -p:CodesignKey="Apple Distribution: AlzBetter LLC (8DVSMQ7G8N)" \
    -p:CodesignProvision="MacOS Distribution" \
    -p:CodesignEntitlements="Platforms/MacCatalyst/Entitlements.plist" \
    -p:EnablePackageSigning=true

I have these keys in info.plist:

<key>CFBundleName</key>
<string>AlzBetter Coach</string>
<key>CFBundleDisplayName</key>
<string>AlzBetter Coach</string>

I have this key in CSPROJ: <ApplicationTitle>AlzBetter Coach</ApplicationTitle>

But when I deploy the build out to the app store, when installed, it installs as "AbMobileMaui" which is the assembly/project name. Apple is refusing to release the app because the app name doesn't match the actual app name (AlzBetter Coach) due to it installing as AbMobileMaui.

What setting/key am I missing here? The iOS build installs perfectly fine as the right app name.

This has been like this for several .net releases - I am just reporting it now.

Steps to Reproduce

Create a mac catalyst app, build in release mode, release to testflight/app store.

Link to public reproduction project repository

No response

Version with bug

9.0.0-rc.2.24503.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

rolfbjarne commented 2 days ago

This is a duplicate of #20615.

As a workaround, I believe you can set the _AppBundleName property on the command line to the desired value:

$ dotnet publish ... /p:_AppBundleName="AlzBetter Coach"

Can you try that and see if it works for you?

caliberdigitalllc commented 1 day ago

This is a duplicate of #20615.

As a workaround, I believe you can set the _AppBundleName property on the command line to the desired value:

$ dotnet publish ... /p:_AppBundleName="AlzBetter Coach"

Can you try that and see if it works for you?

So I tried both "/p" and "-p" and both of them throw an error. "-p" says command not found and "/p" says no such directory.

tried:

dotnet publish -f net9.0-maccatalyst -c Release \
    -p:ArchiveOnBuild=true \
    -p:CreatePackage=true \
    -p:EnableCodeSigning=true \
    -p:CodesignKey="Apple Distribution: AlzBetter LLC (8DVSMQ7G8N)" \
    -p:CodesignProvision="MacOS Distribution" \
    -p:CodesignEntitlements="Platforms/MacCatalyst/Entitlements.plist" \
    -p:EnablePackageSigning=true
    /p:_AppBundleName="AlzBetter Coach"

and

dotnet publish -f net9.0-maccatalyst -c Release \
    -p:ArchiveOnBuild=true \
    -p:CreatePackage=true \
    -p:EnableCodeSigning=true \
    -p:CodesignKey="Apple Distribution: AlzBetter LLC (8DVSMQ7G8N)" \
    -p:CodesignProvision="MacOS Distribution" \
    -p:CodesignEntitlements="Platforms/MacCatalyst/Entitlements.plist" \
    -p:EnablePackageSigning=true
    -p:_AppBundleName="AlzBetter Coach"
rolfbjarne commented 1 day ago

You're missing a backslash at the end of the previous argument:

    [...]
    -p:EnablePackageSigning=true \
    -p:_AppBundleName="AlzBetter Coach"
caliberdigitalllc commented 22 hours ago

You're missing a backslash at the end of the previous argument:

  [...]
    -p:EnablePackageSigning=true \
    -p:_AppBundleName="AlzBetter Coach"

I knew that, I was just testing you. :) Anyhow, that seems to break something at the end of the compile:

/usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/msbuild/iOS/Xamarin.Shared.targets(2839,3): error : dsymutil exited with code 1: error: cannot parse the debug map for '/Users/mitch/Development/abmobile-maui/bin/Release/net9.0-maccatalyst/osx-x64/AlzBetter Coach.app/Contents/MacOS/AbMobileMaui': No such file or directory

If I leave that parameter off, it builds fine (with the wrong name obviously)

rolfbjarne commented 14 hours ago

OK, I can reproduce it, and I think I may have a workaround:

Edit your Info.plist (or create a new one if you don't have one), and then add this:

<key>CFBundleExecutable</key>
<string>AlzBetter Coach</string>
caliberdigitalllc commented 12 hours ago

I get the same error unfortunately.

/usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk.net9.0_18.0/18.0.9600-net9-rc2/tools/msbuild/iOS/Xamarin.Shared.targets(2839,3): error : dsymutil exited with code 1: error: cannot parse the debug map for '/Users/mitch/Development/abmobile-maui/bin/Release/net9.0-maccatalyst/osx-x64/AbMobileMaui.app/Contents/MacOS/AlzBet ter Coach': No such file or directory

It seems to change the output directory name and because it doesn't match the assembly name, it's failing. If I remove that extra key/string, it goes back to the old name and builds fully.