From 3b54903fea4493b38bab714d4fbf47a5ecb542ee Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Thu, 13 Aug 2026 19:32:15 +0200 Subject: [PATCH] Keep global symbols when stripping the Apple release builds Closes #1315 (more like a workaround) --- ios/Runner.xcodeproj/project.pbxproj | 1 + lib/features/nutrition/widgets/widgets.dart | 9 ++++----- macos/Runner.xcodeproj/project.pbxproj | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 006be35e8..87e8fbca4 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -494,6 +494,7 @@ MARKETING_VERSION = "$(FLUTTER_BUILD_NAME)"; PRODUCT_BUNDLE_IDENTIFIER = de.wger.flutter.community; PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_STYLE = "non-global"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/lib/features/nutrition/widgets/widgets.dart b/lib/features/nutrition/widgets/widgets.dart index 8e38a32e2..49a9674dd 100644 --- a/lib/features/nutrition/widgets/widgets.dart +++ b/lib/features/nutrition/widgets/widgets.dart @@ -101,11 +101,10 @@ class _IngredientTypeaheadState extends ConsumerState { context, ).push(MaterialPageRoute(builder: (context) => const ScanReader())); - if (code == null) { - return ''; - } - - if (code == '-1') { + // A decoder that never returns looks exactly like a cancelled scan from + // here, so log the empty result as the only trace it leaves. + if (code == null || code.isEmpty || code == '-1') { + widget._logger.info('Barcode scanner returned no code'); return ''; } return code; diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 156baf450..2429d48ea 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -516,6 +516,7 @@ "@executable_path/../Frameworks", ); PROVISIONING_PROFILE_SPECIFIER = ""; + STRIP_STYLE = "non-global"; SWIFT_VERSION = 5.0; }; name = Release;