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

Archiving .NET MAUI iOS apps not working #3777

Closed
jfversluis opened this issue Dec 15, 2021 · 3 comments · Fixed by #3780
Closed

Archiving .NET MAUI iOS apps not working #3777

jfversluis opened this issue Dec 15, 2021 · 3 comments · Fixed by #3780
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12! platform/iOS 🍎 t/bug Something isn't working

Comments

@jfversluis
Copy link
Member

jfversluis commented Dec 15, 2021

Description

Note: this has already been discussed inside the team (on Teams), so sorry if I go a bit fast with the information here 😅 some things might not look right because I'm copy/pasting some things from the conversation as well

TL;DR: something about LaunchScreen.xib is messing up the archiving because it causes invalid path names on Windows. At this time we're not sure how and why the LaunchScreen.xib is there because we don't even seem to need it. Full story below.

Here is the LaunchScreen.xib.zip from my project, maybe it will give us some hint where it comes from. Inside it has a label with "copyright (c) 2017" and "Sample.iOS"?

Content seems to be identical to this file in the templates and in the Blazor templates.

Full Story

I'm trying to archive my .NET MAUI iOS app (just a File > New project) with this command: dotnet publish -f:net6.0-ios -c:Release /p:ServerAddress=192.168.1.77 /p:ServerUser=jfversluis /p:TcpPort=58181 /p:ArchiveOnBuild=true /p:_DotNetRootRemoteDirectory=/Users/jfversluis/Library/Caches/Xamarin/XMA/SDKs/dotnet/

It seems to go fine for the most part, but then gives me a lot of errors with IL stripping it seems. Binlog can be reviewed here. All the errors are the same except for the filename: error MSB3030: Could not copy the file "obj/Release/net6.0-ios/ios-arm64//stripped/Microsoft.Extensions.Configuration.Abstractions.dll" because it was not found.

Notice how it has a double slash at the stripped folder. If I look at the filesystem and ignore the double slash, all those files are actually in that folder so it seems to mess up the path somehow.

I then added the /p:EnableAssemblyILStripping=false switch to the publish command which skipped the IL stripping and made the process continue. However, a new error came:

C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\15.0.101-preview.11.551\tools\msbuild\iOS\Xamarin.iOS.Common.After.targets(120,3): error : There was an error unzipping the file C:\Users\joverslu\AppData\Local\Xamarin\iOS\Archives\2021-12-10\09afbedf.zip:
The filename, directory name, or volume label syntax is incorrect. : 'C:\Users\joverslu\AppData\Local\Xamarin\iOS\Archives\2021-12-10\MauiApp14 12-10-21 4.34 PM.xcarchive\Products\Applications\MauiApp14.app\C:' [C:\Users\joverslu\source\repos\MauiApp14\MauiApp
14\MauiApp14.csproj]

Binlog of this one is here.

The mentioned zip file from there error above is there, but notice there is a weird additional C:\ near the end of the path.

Since this all happens while paired to a Mac, I was investigating the Mac side of things and looked in the cache for my app. There I found a path like this: /Users/jfversluis/Library/Caches/Xamarin/mtbs/builds/MauiApp14/2a3e956683debac356cc9a5640c1d9d5fd5b17c9cd2cb8fb47201e1b4b4f4cc1/bin/Release/net6.0-ios/ios-arm64/MauiApp14.app/C:/Users/joverslu/source/repos/MauiApp14/MauiApp14/Platforms/iOS/Resources/LaunchScreen.xib

Again, note how there is a folder with C:/ in there. On Mac this works, when copied back to Windows, it causes trouble.

Then there was some investigation (internal link to Teams conversation) but it seems the way the MauiSplashscreen is generated and setup seems OK.

Which leaves us with two potential issues at this time: 1 the existance of it causing issues, and 2 we don't want it there anyway. It being the LaunchScreen.xib.

cc: @Redth @chamons tried to get all the relevant bits out of our conversation, let me know if there is still something missing or I need to provide :)

Steps to Reproduce

  1. Create File > New .NET MAUI project
  2. Try to archive it with a command like dotnet publish -f:net6.0-ios -c:Release /p:ServerAddress=192.168.1.77 /p:ServerUser=jfversluis /p:TcpPort=58181 /p:ArchiveOnBuild=true /p:_DotNetRootRemoteDirectory=/Users/jfversluis/Library/Caches/Xamarin/XMA/SDKs/dotnet/
  3. Observe the errors and story from Description

Version with bug

Preview 10 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

Not tied to a specific iOS version

Did you find any workaround?

Not at this time

Relevant log output

See inline and attached files in Description
@jfversluis jfversluis added t/bug Something isn't working area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/iOS 🍎 labels Dec 15, 2021
@jfversluis
Copy link
Member Author

Just did some poking with a fresh mindset and looked in the xib file (now attached to the issue above) and tried to find where it came from by comparing the content. It seems it's just a static file that comes with out templates. Removing the xib file from my Platforms\iOS\Resources folder makes the error go away and build & publish correctly

@chamons
Copy link

chamons commented Dec 15, 2021

@jfversluis - I'm assuming this is a maui template?

@jfversluis
Copy link
Member Author

@ghost ghost locked as resolved and limited conversation to collaborators Feb 18, 2022
@samhouts samhouts added the fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12! label Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12! platform/iOS 🍎 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants