Skip to content

Commit

Permalink
Load macOS dart bundle by URL fallback (flutter#22979)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmagman committed Dec 10, 2020
1 parent 4338849 commit 3b9937a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle {
NSAssert(self, @"Super init cannot be nil");

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

0 comments on commit 3b9937a

Please sign in to comment.