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

After upgrading to Flutter 3.16 and XCode 15.0.1 I get Error vailability_version_check.cc(39)] Check failed on iOS less than 17 #138711

Closed
2 tasks done
JacoFourie opened this issue Nov 20, 2023 · 27 comments · Fixed by flutter/engine#48624
Assignees
Labels
P1 High-priority issues at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team

Comments

@JacoFourie
Copy link

JacoFourie commented Nov 20, 2023

Is there an existing issue for this?

Steps to reproduce

I upgraded my Flutter to version 3.16 and XCode 15.0.1

Expected results

The app should work after the upgrade

Actual results

Installing and launching...
[FATAL:flutter/shell/platform/darwin/common/availability_version_check.cc(39)] Check failed: AvailabilityVersionCheck.

Code sample

Code sample
Create a blank Flutter project.

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
aunching lib/main.dart on Developmet iphone 6 in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: C...........
Running pod install...
Running Xcode build...
Xcode build done.                                           39,6s
Installing and launching...
[FATAL:flutter/shell/platform/darwin/common/availability_version_check.cc(39)] Check failed: AvailabilityVersionCheck.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1.1 23B81 darwin-arm64, locale en-ZA)
    • Flutter version 3.16.0 on channel stable at /Users/jacofourie/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (5 days ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/jacofourie/Library/Android/sdk
    • Platform android-34, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • Jaco’s iPhone 14 (mobile)    • 00008110-00110C9E1105401E                • ios            • iOS 17.1.1 21B91
    • Developmet iphone 6 (mobile) • 4781749bcc830a01bf3326c466d1d86cea0bc844 • ios            • iOS 12.5.7 16H81
    • macOS (desktop)              • macos                                    • darwin-arm64   • macOS 14.1.1 23B81 darwin-arm64
    • Chrome (web)                 • chrome                                   • web-javascript • Google Chrome 119.0.6045.159

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@josh2112
Copy link

josh2112 commented Nov 20, 2023

Same for me. Runs fine in the iPhone simulator though.

The app appears to get installed (the icon appears in the launcher), but when I tap it it shows the launch image then crashes back to the launcher, printing the following message in the Flutter debug console:

[FATAL:flutter/shell/platform/darwin/common/availability_version_check.cc(39)] Check failed: AvailabilityVersionCheck.

My development iPod is quite old and running iOS version 12.5.5 (I notice you are running iOS 12.5.7, @JacoFourie ). I suspect the minimum required iOS version has been bumped up and we're just out of luck :-(

@mossmana mossmana added platform-ios iOS applications specifically team-ios Owned by iOS platform team labels Nov 20, 2023
@mossmana
Copy link
Contributor

@vashworth Is there a version compatibility matrix we can link to?

@JacoFourie
Copy link
Author

JacoFourie commented Nov 20, 2023

Same for me. Runs fine in the iPhone simulator though.

The app appears to get installed (the icon appears in the launcher), but when I tap it it shows the launch image then crashes back to the launcher, printing the following message in the Flutter debug console:

[FATAL:flutter/shell/platform/darwin/common/availability_version_check.cc(39)] Check failed: AvailabilityVersionCheck.

My development iPod is quite old and running iOS version 12.5.5 (I notice you are running iOS 12.5.7, @JacoFourie ). I suspect the minimum required iOS version has been bumped up and we're just out of luck :-(

https://docs.flutter.dev/reference/supported-platforms

This link states 11 - 15 is best effort, so it should still work. It was not in the breaking changes list. The iPhone 6 still runs my app fine so it should not be excluded from the OS versions.

@hellohuanlin hellohuanlin added triaged-ios Triaged by iOS platform team P1 High-priority issues at the top of the work list labels Nov 20, 2023
@juliansteenbakker

This comment was marked as outdated.

@vashworth
Copy link
Contributor

I'm not very familiar with this availability check, but Xcode 15.0.1 should still support iOS 12 (https://developer.apple.com/support/xcode/). I don't get this error when I run with an iOS 14 simulator or iOS 16.7.2 physical device

Seems like this availability version check was added in flutter/engine#44711. @zanderso Do you have any insight into why this would error for iOS 12?

@zanderso
Copy link
Member

I suspect that #138711 (comment) is the answer here.

The availability check implementation added in flutter/engine#44711 was copied from clang's implementation from its iOS runtime library prior to an ABI breaking change to clang, which allowed Flutter to roll clang forward across the ABI break. Which is to say, the failures on iOS 12 in this issue and #135317 would be happening even without flutter/engine#44711 and leaving clang pinned to the old version.

cc @chinmaygarde @leighajarett

@JacoFourie
Copy link
Author

Xcode 15 does not support iOS 11 (see fluttercommunity/plus_plugins#2169).

I had the same issue, but fixed it by bumping the deployment target to iOS 12 in the podfile, and cleaning and rebuilding the project. (https://stackoverflow.com/a/64075795/13031778 but use iOS 12)

Well this is obviously not the case as my device is iOS 12

@cyjaysong

This comment was marked as duplicate.

1 similar comment
@nakhunchumpolsathien

This comment was marked as duplicate.

@juliansteenbakker
Copy link

juliansteenbakker commented Nov 21, 2023

It seems that my previous answer is incorrect. All of my other projects are failing on iOS 12 with Flutter 3.16 on this error, also on the Beta channel. I think this should have the highest priority right now since this is a stable release which breaks iOS 12.

@diogofos

This comment was marked as duplicate.

@zanderso
Copy link
Member

Does this issue reproduce only with Xcode 15, or does it also happen with earlier versions of Xcode?

Also, folks should be aware of Flutter's issue hygiene policies, especially around comments: https://github.com/flutter/flutter/wiki/Issue-hygiene#comments. Please do not make "me too" comments that don't contribute new information---use the thumbs-up reaction on the original issue report, instead.

@chris-NR
Copy link

This occured with my project (running on iOS 11) using xcode 14.0.1

@egops

This comment was marked as duplicate.

@felipecastrosales
Copy link

felipecastrosales commented Nov 29, 2023

Also happening here.
Every device with iOS 12.x is currently crashing.
Downgrading to 3.13.9 works as expected. I also think this issue should be P0.
Also happens in XCode less than 15.

@zanderso zanderso self-assigned this Nov 30, 2023
@zanderso
Copy link
Member

My previous comment is incorrect. The old clang-rt implementation uses a fallback to a read from a system plist file if the dynamic symbol lookup fails, and Flutter will need to emulate that as well.

@szuwest

This comment was marked as duplicate.

zanderso added a commit to flutter/engine that referenced this issue Dec 11, 2023
This PR ports more of the implementation of availability checking from
clang-rt into the Engine. In particular, when the call to look up the
symbol `_availability_version_check` fails, this PR falls back on
reading the platform version information out of a plist file at a
well-known location, as is done
[here](https://github.com/llvm/llvm-project/blob/2fd66e6eb659701b9d4c88708d55d5854a246815/compiler-rt/lib/builtins/os_version_check.c#L163).

This change fixes a mistake in
#44711, which didn't account for
`_availability_version_check` not being available on iOS 11 and 12.

Fixes flutter/flutter#138711
@zanderso
Copy link
Member

Hi folks, we think this is fixed on the master channel following 67edaef. It would be very much appreciated if anyone who was seeing this could switch over to the master channel and verify that it is fixed. Cheers!

@daomydong1995
Copy link

i was changed channel master but i still get EXC_BAD_ACCESS (code=1, address=0x1170000) on ios

@juliansteenbakker
Copy link

I can confirm that my app is working on Channel master, 3.18.0-7.0.pre.88, on macOS 14.1.2 23B92 darwin-x64, locale nl-NL. The app however does crash after clicking on the home button (Thread 18: EXC_BAD_ACCESS (code=1, address=0xe04000)), but i don't think it is related to this issue.

@dickverweij

This comment was marked as off-topic.

zanderso added a commit to zanderso/engine that referenced this issue Dec 12, 2023
This PR ports more of the implementation of availability checking from
clang-rt into the Engine. In particular, when the call to look up the
symbol `_availability_version_check` fails, this PR falls back on
reading the platform version information out of a plist file at a
well-known location, as is done
[here](https://github.com/llvm/llvm-project/blob/2fd66e6eb659701b9d4c88708d55d5854a246815/compiler-rt/lib/builtins/os_version_check.c#L163).

This change fixes a mistake in
flutter#44711, which didn't account for
`_availability_version_check` not being available on iOS 11 and 12.

Fixes flutter/flutter#138711
@zanderso
Copy link
Member

@juliansteenbakker @daomydong1995 I suspect that you might be hitting a different bug. Would you mind filing a new issue with full details?

@chinmaygarde
Copy link
Member

FWIW, I am not able to reproduce the home button crash in the sample app.

@gokhanikisivri
Copy link

@daomydong1995 @juliansteenbakker I was encountering a similar error. When I updated Xcode to version 15.1, the issue was resolved.

@zanderso

This comment was marked as outdated.

auto-submit bot pushed a commit to flutter/engine that referenced this issue Dec 13, 2023
@zanderso
Copy link
Member

Actually, apologies. The release announcement was mistaken. The change mentioned above will go out in the hotfix release next week.

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 High-priority issues at the top of the work list platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team
Projects
None yet
Development

Successfully merging a pull request may close this issue.