Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] and [CRASH] App Crashes on startup on High Sierra. Runs fine on higher operating systems #13071

Closed
CartBlanche opened this issue Dec 7, 2020 · 9 comments · Fixed by #13314
Labels
e/5 🕔 5 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/macOS t/bug 🐛

Comments

@CartBlanche
Copy link

CartBlanche commented Dec 7, 2020

Description

App crashes on startup on High Sierra, but runs fine on higher Operating Systems.

Steps to Reproduce

  1. Open the Test.sln in this zip file on High Sierra. Build and run it and it will crash on startup
    Test.zip

Exception thrown is : NSInvalidArgumentException: -[NSApplication effectiveAppearance]: unrecognized selector sent to instance 0x600000117340

Crash occurs when calling LoadApplication(new App());
Essentially in the App constructor, but before InitializeComponent(); is called.

Expected Behaviour

No crash on startup and app runs on Hight Sierra

Actual Behaviour

App crashes on startup on High Sierra

Basic Information

  • Version with issue: 5.0.0.1709-pre4
  • Last known good version: No Idea
  • Platform Target Frameworks:
  • MacOS: 7.0.0.15
  • NuGet Packages:
  • Affected Devices: Desktop

Environment

Visual Studio Community 2019 for Mac
Version 8.8.3 (build 16)
Installation UUID: fa27f864-86cf-4f53-9521-9f6ebe07383d
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

Package version: 612000107

Mono Framework MDK
Runtime:
Mono 6.12.0.107 (2020-02/a22ed3f094e) (64-bit)
Package version: 612000107

Roslyn (Language Service)
3.8.0-5.20519.18+4c195c3ac1974edcefa76774d7a59a2350ec55fa

NuGet
Version: 5.8.0.6860

.NET Core SDK
SDK: /usr/local/share/dotnet/sdk/5.0.100/Sdks
SDK Versions:
5.0.100
3.1.404
MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
5.0.0
3.1.10

.NET Core 3.1 SDK
SDK: 3.1.404

Xamarin.Profiler
Version: 1.6.15.68
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Xamarin.Android
Version: 11.1.0.17 (Visual Studio Community)
Commit: xamarin-android/d16-8/c0e2b8e
Android SDK: /Users/neilcarter/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.2

Build Information:
Mono: be2226b
Java.Interop: xamarin/java.interop/d16-8@79d9533
ProGuard: Guardsquare/proguard@ebe9000
SQLite: xamarin/sqlite@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-8@2fb1cbc

Microsoft OpenJDK for Mobile
Java SDK: /Users/neilcarter/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 16.8.0.32
Hash: 01a7774
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:30 UTC

Android Device Manager
Version: 16.8.0.45
Hash: fc0af5f
Branch: remotes/origin/d16-8
Build date: 2020-10-13 23:32:54 UTC

Xamarin Designer
Version: 16.8.0.507
Hash: e87b24884
Branch: remotes/origin/d16-8
Build date: 2020-10-29 00:31:38 UTC

Apple Developer Tools
Xcode 10.1 (14460.46)
Build 10B61

Xamarin.Mac
Version: 7.0.0.15 (Visual Studio Community)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:40-0500

Xamarin.iOS
Version: 14.6.0.15 (Visual Studio Community)
Hash: 87a1b18d8
Branch: d16-8
Build date: 2020-11-16 21:39:41-0500

Build Information
Release ID: 808030016
Git revision: cc6375d2fdcc1b42532e551e24ce650eaca1ae45
Build date: 2020-11-25 13:16:20-05
Build branch: release-8.8
Xamarin extensions: cc6375d2fdcc1b42532e551e24ce650eaca1ae45

Operating System
Mac OS X 10.13.6
Darwin 17.7.0 Darwin Kernel Version 17.7.0
Fri Oct 30 13:34:27 PDT 2020
root:xnu-4570.71.82.8~1/RELEASE_X86_64 x86_64

Build Logs

NA

Screenshots

Reproduction Link

Link is in Steps to Reproduce, above.

Workaround

Unfortunately not.

@CartBlanche CartBlanche added t/bug 🐛 p/macOS i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often s/unverified New report that has yet to be verified labels Dec 7, 2020
@samhouts samhouts added this to New in Triage Dec 7, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Dec 7, 2020

....

@PureWeen PureWeen closed this as completed Dec 7, 2020
Triage automation moved this from New to Closed Dec 7, 2020
@PureWeen PureWeen reopened this Dec 7, 2020
Triage automation moved this from Closed to New Dec 7, 2020
@PureWeen
Copy link
Contributor

PureWeen commented Dec 7, 2020

Wait NM I see you're running on macOS

Reopened

@ErwinDeGroot
Copy link

ErwinDeGroot commented Dec 26, 2020

I have the same problem. Simply creating a new xamarin forms project and adding a macos project will already crash at start up on High Sierra. On Xamarin.Forms 4.6.0.1180 this still works (so I'm going to roll back to this version for now), but the crash happens from Xamarin.Forms 4.7.0.968 onwards.

@CartBlanche
Copy link
Author

@samhouts, @PureWeen Any ETA on this? It has been nearly a month without any information as to whether this is being looked into or not.

Thanks for confirming @ErwinDeGroot.

@CartBlanche
Copy link
Author

@ErwinDeGroot Could you please log into https://docs.microsoft.com/en-us/answers/questions/197673/bug-and-crash-app-crashes-on-startup-on-high-sierr.html and upvote this crash report. Seem they want more people to show they have the crash before they'll look into it.

@jgold6
Copy link
Contributor

jgold6 commented Jan 6, 2021

[NSApplication effectiveAppearance] was added in macOS 10.14 Mojave:
https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance

So someone, somewhere, is calling that method during startup and since the method is not available on macOS 10.13 High Sierra, it crashes.

It seems to be being called here with no version check:

return AppearanceIsDark(NSApplication.SharedApplication.EffectiveAppearance) ? OSAppTheme.Dark : OSAppTheme.Light;

I am not a dev for Xam Forms so I do not know how the team would want to fall back when on High Sierra or older, so I am not going to make a pull request, but ultimately a version check, or check that the method is available, is necessary.

@hartez hartez removed the s/unverified New report that has yet to be verified label Jan 6, 2021
@hartez hartez added this to To do in Other Ready For Work via automation Jan 6, 2021
@hartez hartez added the e/5 🕔 5 label Jan 6, 2021
@hartez hartez removed this from New in Triage Jan 6, 2021
hartez added a commit that referenced this issue Jan 6, 2021
@CartBlanche
Copy link
Author

Great sleuthing @jgold6 !

Other Ready For Work automation moved this from To do to Done Jan 13, 2021
Redth pushed a commit that referenced this issue Jan 13, 2021
@CartBlanche
Copy link
Author

@Redth Is this fix available in Xamarin.Forms 5.x?

@Redth
Copy link
Member

Redth commented Mar 29, 2021

Yes, please see #13314

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e/5 🕔 5 i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often p/macOS t/bug 🐛
Projects
Development

Successfully merging a pull request may close this issue.

6 participants