From f6bf028164d271b6088f6dd72dfed5a55850874e Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 21 Dec 2020 12:26:25 -0800 Subject: [PATCH 1/2] Load App.framework in macOS app --- .../darwin/macos/framework/Source/FlutterDartProject.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm index 0716c1a2ddc24..895a1b22360f0 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm @@ -32,6 +32,9 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { _dartBundle = [NSBundle bundleWithURL:[NSBundle.mainBundle.privateFrameworksURL URLByAppendingPathComponent:@"App.framework"]]; } + if (!_dartBundle.loaded) { + [_dartBundle load]; + } _dartEntrypointArguments = [[NSProcessInfo processInfo] arguments]; // Remove the first element as it's the binary name _dartEntrypointArguments = [_dartEntrypointArguments From cbeff2ccefec66f04777120397e491333f7111a9 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 21 Dec 2020 12:49:58 -0800 Subject: [PATCH 2/2] Use getter isLoaded --- .../darwin/macos/framework/Source/FlutterDartProject.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm b/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm index 895a1b22360f0..4081c44dbe8c7 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm @@ -32,7 +32,7 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle { _dartBundle = [NSBundle bundleWithURL:[NSBundle.mainBundle.privateFrameworksURL URLByAppendingPathComponent:@"App.framework"]]; } - if (!_dartBundle.loaded) { + if (!_dartBundle.isLoaded) { [_dartBundle load]; } _dartEntrypointArguments = [[NSProcessInfo processInfo] arguments];