Skip to content

Commit

Permalink
Load dart bundle by URL fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
jmagman committed Dec 10, 2020
1 parent 1c5992d commit 08b38ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ + (NSString*)flutterAssetsName:(NSBundle*)bundle {
if (bundle == nil) {
bundle = [NSBundle bundleWithIdentifier:[FlutterDartProject defaultBundleIdentifier]];
}
if (bundle == nil) {
bundle = [NSBundle bundleWithURL:[NSBundle.mainBundle.privateFrameworksURL
URLByAppendingPathComponent:@"App.framework"]];
}
if (bundle == nil) {
bundle = [NSBundle mainBundle];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ - (instancetype)initWithPrecompiledDartBundle:(NSBundle*)bundle {
NSAssert(self, @"Super init cannot be nil");

_dartBundle = bundle ?: [NSBundle bundleWithIdentifier:kAppBundleIdentifier];
if (_dartBundle == null) {
_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 08b38ed

Please sign in to comment.