Open kellyiscute opened 2 years ago
Hi @guo40020, thanks for filing the issue.
Please provide a completed and minimal reproducible code sample so that we may verify this. Also, please provide the output of flutter doctor -v
as well. Thank you!
Refer this issue to the related/meta issue: #16092
Thanks for reply.
code sample is in the attachment here
flutter doctor -v
[✓] Flutter (Channel master, 3.1.0-0.0.pre.1757, on macOS 12.5 21G72 darwin-x64, locale zh-Hans-CN)
• Flutter version 3.1.0-0.0.pre.1757 on channel master at /usr/local/Caskroom/flutter/3.0.5/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 922eea8763 (4 weeks ago), 2022-07-20 01:51:04 -0700
• Engine revision 1340e57ffb
• Dart version 2.19.0 (build 2.19.0-13.0.dev)
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/kelly/Library/Android/sdk
• Platform android-31, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 13F100
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• 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 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3)
• IntelliJ at /Users/kelly/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• 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
[✓] IntelliJ IDEA Ultimate Edition (version 2021.3)
• IntelliJ at /Users/kelly/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ IDEA.app
• 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
[✓] VS Code (version 1.67.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.44.0
[✓] Proxy Configuration
• HTTP_PROXY is set
• NO_PROXY is 127.0.0.1,localhost,::1
• NO_PROXY contains localhost
• NO_PROXY contains 127.0.0.1
• NO_PROXY contains ::1
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.5 21G72 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.79
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Hi @guo40020, thanks for providing the sample code.
But it looks like the project is missing ios/Runner.xcworkspace
. Could you please provide it?
Also, could you please provide the steps to reproduce this issue? (A such sample is the repository in the issue #96165, see README.md file)
Here is the sample code with previously missing file
iMsg
target and run
show flutter
.
Hi @guo40020, sorry for the delay.
I'm not entirely sure that there is support for this at the moment. I do see the blank screen and the warnings in my xcode log. I'll label this so someone with more knowledge than myself on this can take a look.
Code sample can be found in https://github.com/flutter/flutter/issues/109530#issuecomment-1217429241
There is a FlutterView
showing, it's just empty.
That Creating MTLCommandBuffer while in background
warning is probably because Skia is checking ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground)
, but sharedApplication
is forbidden in an app extension https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW6
I'm not sure if the empty window behavior is because of Skia, or if something else in the engine that's making a similar assumption about not running in an extension.
The Flutter.framework isn't marked as safe for running in extensions, but I'm not sure if it actually would be if APPLICATION_EXTENSION_API_ONLY
was set, or if it's fundamentally linking on disallowed APIs.
warning build: Linking against a dylib which is not safe for use in application extensions: Build/Products/Debug-iphonesimulator/Flutter.framework/Flutter
Running Flutter in an extension isn't supported as of right now.
This also reproduced with impeller.
Using the Impeller rendering backend.
This isn't a supported use case at the moment. Though if we can create a Metal layer, we ought to be able to support it.
@chinmaygarde I wonder if you might have any pointers to what you think might be causing Flutter to not work in extensions right now, or where one might start to look?
I'm interested in trying to use Flutter for an AUV3 extension as described in e.g. https://github.com/flutter/flutter/issues/16092 and am willing to do some digging to try to make it work.
No worries if you have no ideas, but any pointers to likely places in the engine code or whatever would be useful!
@chinmaygarde Never mind, I think I have this figured out! https://github.com/flutter/flutter/issues/16092#issuecomment-1288192913
@chinmaygarde @jmagman @guo40020
any luck or any news on this? imessage support would be awesome. thanks
I was recently trying to create an imessage extension embeded into my app. I tried using
FlutterEngine
to show aFlutterViewController
. However it shows an empty screen and there appears two duplicate warningsCreating MTLCommandBuffer while in background.
but when I tried creating a same thing in native code, it shows no warning.So is there any possibilities that Flutter would work in an imessage extension?