Skip to content

Commit 3b9937a

Browse files
authored
Load macOS dart bundle by URL fallback (flutter#22979)
1 parent 4338849 commit 3b9937a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

shell/platform/darwin/macos/framework/Source/FlutterDartProject.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle {
2727
NSAssert(self, @"Super init cannot be nil");
2828

2929
_dartBundle = bundle ?: [NSBundle bundleWithIdentifier:kAppBundleIdentifier];
30+
if (_dartBundle == nil) {
31+
// The bundle isn't loaded and can't be found by bundle ID. Find it by path.
32+
_dartBundle = [NSBundle bundleWithURL:[NSBundle.mainBundle.privateFrameworksURL
33+
URLByAppendingPathComponent:@"App.framework"]];
34+
}
3035
_dartEntrypointArguments = [[NSProcessInfo processInfo] arguments];
3136
// Remove the first element as it's the binary name
3237
_dartEntrypointArguments = [_dartEntrypointArguments

0 commit comments

Comments
 (0)