Skip to content
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

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

Closed
rolfbjarne opened this issue Jun 11, 2024 · 13 comments · Fixed by #20719 or #20720
Closed

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

rolfbjarne opened this issue Jun 11, 2024 · 13 comments · Fixed by #20719 or #20720
Assignees
Labels
bug If an issue is a bug or a pull request a bug fix
Milestone

Comments

@rolfbjarne
Copy link
Member

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)

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:

<!-- Specify the category for your app here. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
<!-- <key>LSApplicationCategoryType</key> -->
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
<key>UIDeviceFamily</key>
<array>
    <integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
    <string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
<key>MinimumOSVersion</key>
<string>15.0</string>
<key>CFBundleIdentifier</key>
<string>com.alzbetterai.app</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to the microphone to provide voice interaction features.</string>
<key>NSCameraUsageDescription</key>
<string>This app requires access to the camera to capture photos and videos for app features.</string>

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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

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

@rolfbjarne
Copy link
Member Author

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
Copy link
Member Author

@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.

@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Jun 12, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Jun 12, 2024
@rolfbjarne rolfbjarne self-assigned this Jun 12, 2024
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jun 12, 2024
…archives.

* Don't set SolutionName/SolutionPath anymore. Xcode doesn't, and in any case we
  don't get the solution path when building MSBuild projects anyways, so we weren't
  setting these values to anything sensible (we'd get "*Undefined*" for some reason).
* Set the Architectures array, which Xcode does. This requires passing RuntimeIdentifier(s)
  to the task, so do that.
* Set SchemeName, which Xcode does.

This is a partial fix for xamarin#20714.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jun 12, 2024
…yst.

Change how we compute DTPlatformName so that it's 'macosx' for Mac Catalyst.
The PlatformUtils.GetTargetPlatform returns SdkPlatform for all platforms
except Mac Catalyst, where it returns the same as for macOS (i.e. 'macosx').
It also returns a lowercased value, so we don't need to do that either.

This is a partial fix for xamarin#20714.
@caliberdigitalllc
Copy link

@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
Copy link

@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
Copy link
Member Author

hopefully you guys can figure out the unknown scheme too.

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

rolfbjarne added a commit that referenced this issue Jun 17, 2024
…yst. (#20720)

Change how we compute DTPlatformName so that it's 'macosx' for Mac Catalyst.
The PlatformUtils.GetTargetPlatform returns SdkPlatform for all platforms
except Mac Catalyst, where it returns the same as for macOS (i.e. 'macosx').
It also returns a lowercased value, so we don't need to do that either.

This is a partial fix for #20714.
@caliberdigitalllc
Copy link

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
Copy link
Member Author

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 added a commit that referenced this issue Jun 25, 2024
…archives. (#20719)

* Set the Architectures array, which Xcode does. This requires passing RuntimeIdentifier(s)
  to the task, so do that.
* Set SchemeName, which Xcode does.

This is a partial fix for #20714.

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
@rolfbjarne
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix
Projects
None yet
2 participants