mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
38 lines
1.6 KiB
Diff
38 lines
1.6 KiB
Diff
This patch introducing error handling in the invocation of packagesWithNativeAssets within flutter_tools.
|
|
|
|
--- a/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
|
|
+++ b/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
|
|
@@ -357,7 +357,15 @@
|
|
}
|
|
|
|
Future<bool> _nativeBuildRequired(FlutterNativeAssetsBuildRunner buildRunner) async {
|
|
- final List<String> packagesWithNativeAssets = await buildRunner.packagesWithNativeAssets();
|
|
+ late final List<String> packagesWithNativeAssets;
|
|
+ try {
|
|
+ packagesWithNativeAssets = await buildRunner.packagesWithNativeAssets();
|
|
+ } catch (error, stackTrace) {
|
|
+ globals.logger.printTrace(
|
|
+ 'Error while checking for native assets packages: $error\n$stackTrace'
|
|
+ );
|
|
+ packagesWithNativeAssets = <String>[];
|
|
+ }
|
|
if (packagesWithNativeAssets.isEmpty) {
|
|
globals.logger.printTrace(
|
|
'No packages with native assets. Skipping native assets compilation.',
|
|
@@ -385,7 +393,15 @@
|
|
FileSystem fileSystem,
|
|
FlutterNativeAssetsBuildRunner buildRunner,
|
|
) async {
|
|
- final List<String> packagesWithNativeAssets = await buildRunner.packagesWithNativeAssets();
|
|
+ late final List<String> packagesWithNativeAssets;
|
|
+ try {
|
|
+ packagesWithNativeAssets = await buildRunner.packagesWithNativeAssets();
|
|
+ } catch (error, stackTrace) {
|
|
+ globals.logger.printTrace(
|
|
+ 'Error while checking for native assets packages: $error\n$stackTrace'
|
|
+ );
|
|
+ packagesWithNativeAssets = <String>[];
|
|
+ }
|
|
if (packagesWithNativeAssets.isEmpty) {
|
|
globals.logger.printTrace(
|
|
'No packages with native assets. Skipping native assets compilation.',
|