-
Notifications
You must be signed in to change notification settings - Fork 506
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
App startup crashes on iOS 17.0 / NewsstandKit issues #18964
Comments
The Visual Studio versions is correct? This version is not available for Mac OS. Latest version for Max OS is 17.6.3 |
Does this only affect Xamarin.Forms and MAUI apps or also Xamarin.iOS apps? |
For macOS you can just install the package "xamarin.ios-16.4.0.18.pkg" (link in the description)
It may also affect Xamarin.iOS apps. |
FWIW: VS on Mac will ask for upgrade after manually installing the 16.4.018 package. Do not install that update, since is it a downgrade and will cause your iOS app to crash again. |
Is there a way to debug Xamarin.iOS apps on iOS 17? The debugger doesn't seem to connect for me despite launching the app manually. Does this require XCode 15 and therefore will not be supported for Xamarin.iOS apps? |
I am using XCode 14.3.1, since Xamarin Forms does not support XCode 15. I can debug apps but had a hard time pushing a new version to Apple for review. |
Debugging started working after a reboot. Debugging also seems to work using XCode 15 as well. Although not officially supported by Microsoft, does the fact that Xamarin.iOS 16.4.0.18 seem to work with XCode 15 beta 8 to build a Xamarin.iOS app mean that we may have an additional year of use out of it before having to switch to .Net? This would be assuming we don't need iOS 17 specific APIs and assuming no breaking changes by Apple with future XCode 15 point releases. |
Good to hear that a reboot worked. WOW! If XCode 15 'works' with Xamarin.iOS that would be very good news indeed. There was another issue raised here with a lot op people complaining that XCode 15 is not supported - and never will, unless the source code is ported to MAUI. Even if this is not officially supported, it would give everyone some slack. |
@RobSchoenaker That would make me and my team very happy indeed. I can add to this that the additional build argument |
@jtorvald - I may be repeating something here, but just to be clear: you can omit that build argument when using the linked "xamarin.ios-16.4.0.18.pkg" package from @dalexsoto |
@RobSchoenaker good to know. Can I ask what happens if we would update VS for Mac at this point? |
@jtorvald I will try to clarify - probably was not clear enough. @dalexsoto mentioned the update package in the first message in this thread. When you install that package on your Mac and (re)start Visual Studio, you will be prompted to install an older version of xamarin.ios. I believe it was 16.4.0.16, which obviously will cause debugging to fail again if you removed the additional build argument. Just ignore the message from VS for Mac to 'update', which is actually a 'downgrade'. I suppose VS for Mac will need to be updated to not mention the 'update/downgrade' now. Does this make sense? |
@RobSchoenaker yeah that makes sense. I thought you wrote not to update VS itself. Thanks. |
@dalexsoto Hi, you are referring to https://download.visualstudio.microsoft.com/download/pr/de7f727f-243c-4429-8773-eebd735eb1bb/da4a65f27ace7f805914ef63661e0efd/xamarin.ios-16.4.0.18.pkg - Where did you find this release and where can I see the release notes? Thanks a lot |
I'm confused...I've updated VS2022 to 17.7.4 which includes XMI 16.4.0.15 and I let it update the paired mac to the same 16.4.0.15. I'm no longer seeing strong references to NewsstandKit like I was previously, but weak references and I didn't change any mtouch args to force it as weak either. As such, installing 16.4.0.18 appears to be entirely unnecessary. So what is 16.4.0.18 is really need for then if the strong reference is gone in 16.4.0.15? |
We had to do multiple fixes to remove the strong reference in all cases. Your project may only run into the first scenarios we fixed (and released) - which means you don't need 16.4.0.18, 16.4.0.15 may be enough. That doesn't mean other's won't. |
Ok thanks. It would be great if these versions were tagged to make tracking easier... For anyone that is curious, the 16.4 packages are built from the xcode14.3 branch and .15 has hash 8c3876d and .18 has hash 9d26602. Here is the compare 8c3876d...9d26602. To find the hashes for a pkg you can cat /Library/Frameworks/Xamarin.iOS.framework/Versions/w.x.y.z/buildinfo if you install it, or extract it via pkg-util on the mac or 7zip from windows - it is nested inside the monotouch.pkg/Payload/Payload~ file. |
Has the Azure XamariniOS Pipeline task (https://moasure.visualstudio.com/Moasure2020/_build/results?buildId=1408&view=logs&j=d0c55d57-dc89-5219-b43a-87fc3bd7617e&t=760a608d-127a-5ce2-ccd3-71f0e97908ad&l=7) Have the correct above mentioned Xamarin IOS package update? Can we rely on build from Azure using this task to work fine on iOS 17? |
By the looks of the log, its only using 16.0.0.72 with XCode 14.2 - which seems quite far behind. Is there anything we can do to ensure the latest is used? Are there plan to update Azure devops (and soon)? I see the MacOS image that was used in one of our builds is macos-12 ... so this might be on us for neglecting to use a newer image (I can see macOS-13 is available, but that macOS-latest still points to 12?) EDIT: Oh. Great. MacOS-13 image doesn't have Xamarin installed/support? So is Azure DevOps support for Xamarin dropped sooner than the May 2024 deadlline? |
I think these questions are better asked to the Azure DevOps team here: https://github.com/actions/runner-images/issues |
Can Verify. I've installed 16.4.0.18 on my Mac, XCode 15 (not the beta, the release) and just ran a debug build and debugger connected all fine to my iPhone. I don't have the NewsstandKit API issue as were Xamarin native with linker turned on so it is/was being stripped anyway. But I have Xamarin IOS, on a mac, building with Xcode 15 and debugging straight to my iOS 17 device 👍 (No idea if an IPA would go through app store submittion mind) EDIT - Also this VS Mac only, Rider doesn't appear to recognise the iOS 17 device when its plugged in like VS Mac does. But I managed to build to an iOS 16 device with XCode 15 in Rider fine. |
I'm a bit confused on how install Xamarin.iOS16.4.0.18 properly. I use VS for Windows. After installing the package on my Mac, of course now when I pair, VS complains that the versions are mismatched. AND, note -- I installed XCode 15 before this (somewhat unintentionally), and I can still build & debug on my iOS16.6 devices, but not on my iOS 17 devices. |
How do I get this to work for a Maui / Microsoft.iOS project on macOS? I have 7.0.401 & 8.0.100-rc.1 installed and I still get the error. I tried adding |
Windows is a bit more complicated, but I believe there's a way to skip the version check. I'll investigate and get back to you. |
It works fine for me too with this version and XCode 15. Only issue is I need to manually start the app when debugging. My main question that remains is, are we safe for iOS 17.x in general now? So does this mean we have until iOS 18/Xcode 16 before we can run into issues again? |
You are never safe my friend, this is Microsoft. |
@pvma @phillippschmedt Are you on a macOS Sonoma or some other version? For me, the proposed workaround only fixes the absence of devices/simulators in the list of deployement targets. Application itself is not deployed to the selected device. |
Yes, I am on macOS Sonoma |
Yes we already started migrating our app. But MAUI and its ecosystem is so unstable for us, that every month more we have before we are forced to move is a big relief. So the actual question is for people familiar with the issues arising from iOS Updates. My understand is that with 17.1 we will get a new XCode Version and then again we are in the risk of xamarin breaking. At the same time Apple is usually giving us around 6 months before rejecting apps build with the old xcode versions in the app stores. To me that means, after 17.1 release, we will have around another 6 months before we risk of running into issues again. Can anyone support or deny this claim? |
I am on latest Ventura 13.5.2, XCode 15, latest VS for Mac, and the xamarin version from this github issue. I usually work with Rider, Rider lists my iOS 17 device as incompatible. Deployment with VS for Mac works fine. App doesn't auto start after deployment, I need to manually start it on the device. |
Thank you for the prompt and detailed answer. Will try to reset my env and start over with a clean setup. Maybe this will help. |
https://devblogs.microsoft.com/dotnet/announcing-dotnet-maui-in-dotnet-8-rc-2/ Bonus 2: Xcode 15 and Android API 34 |
I updated today to the newest VS Version 17.7.5, but still getting the error on XCODE 15 and ISO 17.0.3 The application get pushed to the device, but debugger crashing with: Rebooted everything already many time! error MT1007: Failed to launch the application '/Users/markus/Library/Caches/Xamarin/mtbs/builds/CycleProCut/fddf4f2e7c374baf78f3512d57eb3202069ef7c9fd586893e5d728a34a19d339/bin/Debug/net7.0-ios/ios-arm64/device-builds/iphone12.5-17.0.3/CycleProCut.app' on the device 'iPhone 11 von Markus': Failed to launch the application 'com.companyname.cycleprocut' on the device 'iPhone 11 von Markus': Invalid Service Error (error: 0xe8000022) Thanks, Markus |
We've released the fix for this:
This is a known issue, Apple completely rewrote how the communication between the device and the Mac happens, so we have to figure out how to support launching on device using their new code. Hopefully we'll have this fixed relatively soon. |
Is there a Github item we can follow that tracks that issue? |
I've implemented a fix, and we'll try to get this released asap. |
Anymore updates on this? We have customers bombing and need a fix asap. Our Xamarin.Form apps crashes right aways as explained in this post. |
It's explained in the first post how to fix it. Needing to launch the app manually to debug is a separate thing - and does not stop you doing a build the will work for your customers. |
We make our build with a DevOps Azure pipleline so we are kindof stuck. |
We use VS App Center, which is very slow to update, but the |
Well you're in for bad news, this fix is unlikely to make it onto azure DevOps. I posted asking and basically got a 'no' response. This issue is, it needs osx13 in order to install the later Xcode, and the mac13 image does not have Xamarin support. Only the lower mac12 image does, but it can't have Xcode 15 so can't have this fix installed. Your options are to do manual builds and upload those. Or you can target mac13 image but you'll have to have build steps to install the Xamarin packages you need first. Either way you'll likely have to look into sorting this yourself I think. |
With the "--weak-framework=NewsstandKit.framework/NewsstandKit" args are you able to debug or just make a build and it works? I tried the args and debugging doesn't work but have yet to try making an ipa and testing that out. |
Yes, I haven't updated Xcode or installed the latest VS and Xamarin packages (so that I match App Center) and can still debug locally. I added that argument to all the build configs and it's working fine in iOS 17. App Center had no issue building and uploading to the store. Had it released a week before iOS 17 dropped. |
People keep mentioning AppCenter so I'll put this bit of info here. Use boots to install later version Xamarin iOS and Android packages and don't wait for them to update it. https://github.com/jonathanpeppers/boots Additionally I went back and forwards with AppCenter support about Xcode 14.3 support. It (and 15) are available in some of their other iOS build systems (native and react from memory) but not the Xamarin ones. I asked if we they can just add the build step to install Xamarin with booths on the later macOS images which should then have all the other required parts. That has gone back to their engineering team to determine if it's possible/viable 🤞 |
As it turns out I didn't have to do the --weak args. All I did was to add this to the App.xaml:
One of the crashes we were only gettiing on ios17 was:
After doing that my application currently is working fine. We are still doing more test but ios17 so far starts up with no problems. Hopefully customers will have same good results. |
If you have a Xamarin.Forms / MAUI app that targets iOS and has been built with Xcode 14.3.1 there is a high chance that this app will crash at startup on iOS 17. This is because Apple removed NewsstandKit from iOS 17.0 and there is a chance that your App is referencing this Framework depending on your linker settings.
In order to avoid this problem you will need to recompile your application:
.NET / MAUI
Xamarin.iOS / Xamarin.Forms
Detect if an app is affected
It's possible to detect whether an app is affected by using
otool
from the command line to check if the app is linking (not weakly) with the NewsstandKit framework.This app is affected, because
cmd=LC_LOAD_DYLIB
:This app is not affected, because
cmd=LC_LOAD_WEAK_DYLIB
means it's linking weakly withNewsstandKit
:This app is also not affected, because it doesn't link with NewsstandKit at all:
$ otool -l path/to/Debug/testapp.app/testapp | grep NewsstandKit -C 3 [no output]
Alternatively install an iOS 17 beta on a device and try to run the app. If it launches successfully, it's not affected.
The text was updated successfully, but these errors were encountered: