AngeloAvv / flutter_flavorizr

A flutter utility to easily create flavors in your flutter application
https://pub.dev/packages/flutter_flavorizr
MIT License
468 stars 85 forks source link

Seeing an Error on #168

Closed paulinventome closed 1 year ago

paulinventome commented 1 year ago

Just added some extra flavours for a project that had 2 already. Also updated to 2.1.6 and ran flutter pub run flutter_flavorizr

But I am seeing an exception with the plist, but there are no details that help me work out why. I have done a flutter clean, which can often clean up issues.

I'm pasting the error below, is there any way I can find out what the problem is?

help!

Thanks Paul

[code] Executing task ios:plist Unhandled exception: The following resource is malformed: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

BGTaskSchedulerPermittedIdentifiers $(PRODUCT_BUNDLE_IDENTIFIER) CADisableMinimumFrameDurationOnPhone CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(BUNDLE_NAME) CFBundlePackageType APPL CFBundleShortVersionString $(MARKETING_VERSION) CFBundleSignature ???? CFBundleURLTypes CFBundleTypeRole Editor CFBundleURLName toolbankb2b.com CFBundleURLSchemes b2bapp CFBundleVersion $(FLUTTER_BUILD_NUMBER) FlutterDeepLinkingEnabled LSRequiresIPhoneOS NSCameraUsageDescription To scan barcodes for order entry UIApplicationSupportsIndirectInputEvents UIBackgroundModes fetch processing remote-notification UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UISupportedInterfaceOrientations~ipad UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIViewControllerBasedStatusBarAppearance

0 IOSPListProcessor._updatePListValueAtKey (package:flutter_flavorizr/processors/ios/ios_plist_processor.dart:84:7)

1 IOSPListProcessor._updateCFBundleDisplayName (package:flutter_flavorizr/processors/ios/ios_plist_processor.dart:63:55)

2 IOSPListProcessor.execute (package:flutter_flavorizr/processors/ios/ios_plist_processor.dart:48:5)

3 AbstractFileStringProcessor.execute (package:flutter_flavorizr/processors/commons/abstract_file_string_processor.dart:41:31)

4 Processor.execute (package:flutter_flavorizr/processors/processor.dart:116:24)

[/code]
AngeloAvv commented 1 year ago

Hello @paulinventome , can you validate it against this?

The processor looks for the following keys and values:

CFBundleName
$(BUNDLE_NAME)
CFBundleDisplayName
$(BUNDLE_DISPLAY_NAME)
UILaunchStoryboardName
$(ASSET_PREFIX)LaunchScreen

if the processor cannot spot these values, it will throw an error.

That's why flutter_flavorizr is meant to run once and only once, for now

wwnOddbit commented 1 year ago

I'm experiencing the same issue when adding a new flavor and re-running flavorizr. Any suggestions on what we should do/delete before re-running flavorizr?

The line I commented out seems to cause my error. ios_plist_processor.dart

image

Thanks for this great package.

RYO1223 commented 1 year ago

In my environment, CFBundleDisplayName is not defined in ios/Runner/Info.plist.

I don't know if it wasn't there when I execute flutter create or if it was manually deleted at some point, but it worked by adding it manually!

Screenshot 2023-05-24 at 18 54 21