Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Jan 12, 2021

Reverts #23362

Fixes flutter/flutter#73764

Caused framework test failure:

stdout:                /Users/flutter/.cocoon/flutter/bin/cache/artifacts/engine/ios-release/Flutter.xcframework/ios-armv7_arm64/Flutter.framework/Headers/FlutterViewController.h:52:72: error: cannot find protocol declaration for 'UIPointerInteractionDelegate'
stdout:                    : UIViewController <FlutterTextureRegistry, FlutterPluginRegistry, UIPointerInteractionDelegate>
stdout:                                                                                       ^
stdout:                1 error generated.
stdout:                In file included from /Users/flutter/.cocoon/flutter/packages/integration_test/ios/Classes/IntegrationTestPlugin.m:5:
stdout:                /Users/flutter/.cocoon/flutter/packages/integration_test/ios/Classes/IntegrationTestPlugin.h:5:9: fatal error: could not build module 'Flutter'
stdout:                #import <Flutter/Flutter.h>
stdout:                 ~~~~~~~^
stdout:                2 errors generated.

@jmagman jmagman merged commit affaca3 into master Jan 12, 2021
@jmagman jmagman deleted the revert-23362-gwright-ios-mouse branch January 12, 2021 02:24
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 12, 2021
@gaaclarke
Copy link
Member

@jmagman @godofredoc What version of the SDK are we compiling with? That symbol was introduced in iOS 13.4 which came with xcode 11.4 which was released in March 2020. The real fix should be to update the xcode version in the bots, it's almost a year old. The cost to developers to have to accommodate old build systems is greater than the cost to upgrade xcode on the bots. I know we were hesitant to upgrade to xcode 12, but this should just be a matter of upgrading to a new version of 11.

@jmagman
Copy link
Member Author

jmagman commented Jan 12, 2021

It's not an Xcode problem, it's that newly Flutter-created apps have a minimum version of iOS 9 (and older ones iOS 8), so APIs with availability newer than that need to be guarded. You see this error on the latest version of Xcode as well.

@gw280
Copy link
Contributor

gw280 commented Jan 12, 2021

Ah ok, it sounds like we only need to guard the public headers. That should be an easy fix.

@gaaclarke
Copy link
Member

gaaclarke commented Jan 12, 2021

I think you are mistaken. The minimum version should only affect guards around methods. For example, a method that is only available in iOS 10 and higher would generate an error without an @available guard if the minimum target is iOS 9.

When it comes to the availability of symbols, that is solely decided by the SDK with which you are compiling the source code.

@gaaclarke
Copy link
Member

This is how I explained it to George over chat: "the SDK makes all symbols available statically, but the ios target version determines what needs a runtime check to be used".

@jmagman
Copy link
Member Author

jmagman commented Jan 12, 2021

You're right, it's not availability guards. Our minimum version for our users is Xcode 11, though, so we can't just bump up the test bots until it passes.
This worked on Xcode 11:

    : UIViewController <FlutterTextureRegistry, FlutterPluginRegistry
#if defined(__IPHONE_13_4)
                                               , UIPointerInteractionDelegate
#endif
>

But there's probably a better way.

@godofredoc
Copy link
Contributor

In the engine we are using xcode 11.3, I upgraded it from 11.0 in december.

@jmagman
Copy link
Member Author

jmagman commented Jan 12, 2021

Our users on the minimum allowed version of Xcode (by the Flutter tool) will see this error, regardless of what the engine bots are on.

@gaaclarke
Copy link
Member

gaaclarke commented Jan 12, 2021

@jmagman That will only work if Apple's API code is using respondsToSelector: in their APIs not conformsToProtocol: Since it's closed source API we can't know for sure what it is using.

edit: We could know if there was some way to write an integration test. We couldn't think of a way to do that since there is the hardware requirement of using a mouse.

@gaaclarke
Copy link
Member

I don't think we've ever advertised a minimum SDK required to compile the engine. I think it has always been the latest SDK.

@gw280
Copy link
Contributor

gw280 commented Jan 12, 2021

I vote we guard the public headers and file an issue to update the Xcode on the bots in the future. I don't think this PR needs to be tied to updating Xcode.

@godofredoc
Copy link
Contributor

We are moving devicelab test to luci, over the next weeks. Once that is complete we will have the functionality to migrate engine/sdk/devicelab to the xcode versions we want with a single config and a little bit of extra work to create the xcode bundle with all the flutter dependencies.

@gaaclarke
Copy link
Member

gaaclarke commented Jan 12, 2021

I vote we guard the public headers and file an issue to update the Xcode on the bots in the future. I don't think this PR needs to be tied to updating Xcode.

If you want to do that we should test that compiling with xcode 11.3 will execute correctly with mouse support. We don't have a way to automate that test that I know of. You'll just have to do it manually. (edit: to make sure Apple isn't using conformsToProtocol:)

gspencergoog pushed a commit to gspencergoog/engine that referenced this pull request Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS builds fail in devicelab, cannot find protocol declaration for 'UIPointerInteractionDelegate'

5 participants