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.47k stars 514 forks source link

MacCatalyst build on mac results in "Unknown Scheme", but iOS build working fine. #20714

Closed rolfbjarne closed 4 months ago

rolfbjarne commented 4 months ago

From @caliberdigitalllc on Sun, 09 Jun 2024 18:03:29 GMT

Description

When I build my Maui app (.net core 9 preview 4), the iOS build loads into organizer for test flight deployment fine, but the Mac build loads in as "Unknown Scheme".

image

Steps to Reproduce

My iOS build command is: dotnet publish -f net9.0-ios -c Release -p:ArchiveOnBuild=true -p:CodesignKey="ACAA1377B9F55A124AF8FB28BB218352AA3DC7B9" -p:CodesignProvision="ad3e7c5a-dcb6-4834-9841-12e2e79b4f81" -p:CodesignTeamId="8DVSMQ7G8N"

Which is working perfect. I get a build I can send to TestFlight, and all is well.

The Mac command, I have tried countless iterations of this command with various parameters being changed based on googling, and no luck.

dotnet publish -f net9.0-maccatalyst -c Release -p:MtouchLink=SdkOnly -p:UseHardenedRuntime=true -p:CreatePackage=true -p:EnableCodeSigning=true -p:EnablePackageSigning=true -p:ArchiveOnBuild=true -p:CodesignKey="Apple Distribution: AlzBetter LLC (8DVSMQ7G8N)" -p:CodesignProvision="0d81ee50-7a46-44e6-8f61-5671fa4a92fa" -p:CodesignTeamId="8DVSMQ7G8N" -p:CodesignEntitlements="Platforms/MacCatalyst/Entitlements.plist"

My iOS Info.plist (again, this build works great) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

LSRequiresIPhoneOS UIDeviceFamily 1 2 UIRequiredDeviceCapabilities arm64 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UILaunchStoryboardName AlzBetterAI XSAppIconAssets Assets.xcassets/appicon.appiconset CFBundleIdentifier com.alzbetterai.app CFBundleShortVersionString 2.0.0 MinimumOSVersion 15.0 NSMicrophoneUsageDescription This app requires access to the microphone to provide voice interaction features. NSCameraUsageDescription This app requires access to the camera to capture photos and videos for app features.

versus my mac info.plist: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

UIDeviceFamily 2 UIRequiredDeviceCapabilities arm64 UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight XSAppIconAssets Assets.xcassets/appicon.appiconset MinimumOSVersion 15.0 CFBundleIdentifier com.alzbetterai.app CFBundleShortVersionString 2.0.0 NSMicrophoneUsageDescription This app requires access to the microphone to provide voice interaction features. NSCameraUsageDescription This app requires access to the camera to capture photos and videos for app features.

Link to public reproduction project repository

No response

Version with bug

9.0.0-preview.4.10690

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

Relevant log output

I get no errors. The build comes out successfully with no warnings provided. I see the .pkg file in the release folder.

Copied from original issue dotnet/maui#22942

rolfbjarne commented 4 months ago

From @github-actions[bot] on Sun, 09 Jun 2024 18:03:58 GMT

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

rolfbjarne commented 4 months ago

From @drasticactions on Mon, 10 Jun 2024 04:08:55 GMT

@rolfbjarne Would this be specific to the MAUI tooling?

@caliberdigitalllc If you try building a Mac Catalyst app (dotnet new maccatalyst) that doesn't implement the MAUI UI Toolkit, can you deploy that to testflight?

rolfbjarne commented 4 months ago

From @rolfbjarne on Mon, 10 Jun 2024 09:36:36 GMT

@rolfbjarne Would this be specific to the MAUI tooling?

I don't think so, if this turns out to be a bug, it would probably belong to xamarin-macios.

rolfbjarne commented 4 months ago

From @caliberdigitalllc on Mon, 10 Jun 2024 10:35:06 GMT

@rolfbjarne Would this be specific to the MAUI tooling?

@caliberdigitalllc If you try building a Mac Catalyst app (dotnet new maccatalyst) that doesn't implement the MAUI UI Toolkit, can you deploy that to testflight?

That also went to "Unknown Scheme". I did assign the bundle that matched the certificate of course, that was the only change I made to the dotnet new template that was generated.

rolfbjarne commented 4 months ago

From @caliberdigitalllc on Tue, 11 Jun 2024 11:42:30 GMT

Just a ping @drasticactions, this has us pretty blocked up.

rolfbjarne commented 4 months ago

From @drasticactions on Tue, 11 Jun 2024 11:52:27 GMT

@caliberdigitalllc This needs to get moved to xamarin/xamarin-macios. This isn't a MAUI UI bug but seems like an underlying tooling bug and can't be fixed here. I don't have the power to do that.

@rolfbjarne (Or anyone with that power) Could you please move this?

rolfbjarne commented 4 months ago

@caliberdigitalllc can you try adding this to the Info.plist file for Mac Catalyst:

<key>DTPlatformName</key>
<string>macosx</string>

It won't solve the "Unknown Scheme" part, but for me it at least lets me distribute the app.

caliberdigitalllc commented 4 months ago

@caliberdigitalllc can you try adding this to the Info.plist file for Mac Catalyst:

<key>DTPlatformName</key>
<string>macosx</string>

It won't solve the "Unknown Scheme" part, but for me it at least lets me distribute the app.

Just keeping this one alive, I'll be testing this idea later today, will update with results.

caliberdigitalllc commented 4 months ago

@caliberdigitalllc can you try adding this to the Info.plist file for Mac Catalyst:

<key>DTPlatformName</key>
<string>macosx</string>

It won't solve the "Unknown Scheme" part, but for me it at least lets me distribute the app.

This did indeed let me distribute to test flight. So at least there’s that. Perhaps adding that into the default info.plist for preview 6 would be good :-) hopefully you guys can figure out the unknown scheme too.

rolfbjarne commented 4 months ago

hopefully you guys can figure out the unknown scheme too.

Yes, I have a pull request in progresse that fixes this as well.

caliberdigitalllc commented 4 months ago

hopefully you guys can figure out the unknown scheme too.

Yes, I have a pull request in progresse that fixes this as well.

Do I have to change anything on my end once Preview 6 comes out with this fix for your unknown scheme fix to take effect?

rolfbjarne commented 4 months ago

hopefully you guys can figure out the unknown scheme too.

Yes, I have a pull request in progresse that fixes this as well.

Do I have to change anything on my end once Preview 6 comes out with this fix for your unknown scheme fix to take effect?

No, there are no changes required on your part.

rolfbjarne commented 4 months ago

hopefully you guys can figure out the unknown scheme too.

Yes, I have a pull request in progresse that fixes this as well.

Do I have to change anything on my end once Preview 6 comes out with this fix for your unknown scheme fix to take effect?

No, there are no changes required on your part.

Note that it's probably not going to be fully fixed in preview 6, only in preview 7.