flutter_distributor icon indicating copy to clipboard operation
flutter_distributor copied to clipboard

Incomplete documentation

Open ollyde opened this issue 2 years ago • 7 comments

Using the default example provided here https://distributor.leanflutter.org/docs/publishers/appstore

Exception: Missing/incomplete `distribute_options.yaml` file.
#0      FlutterDistributor.release (package:flutter_distributor/src/flutter_distributor.dart:289:7)
#1      CommandRelease.run (file:///Users/oliverdixon/.pub-cache/hosted/pub.dartlang.org/flutter_distributor-0.2.2/bin/command_release.dart:33:23)
#2      CommandRunner.runCommand (package:args/command_runner.dart:209:27)
#3      main (file:///Users/oliverdixon/.pub-cache/hosted/pub.dartlang.org/flutter_distributor-0.2.2/bin/main.dart:38:16)

Also, there is no example of ExportOptions.plist?

ollyde avatar Jun 08 '22 12:06 ollyde

You need to create the distribute_options.yaml file in the project root directory

lijy91 avatar Jun 08 '22 12:06 lijy91

@lijy91 yes I have that. I have an existing version working with MacOS but it throws this error all the time for iOS.

ollyde avatar Jun 08 '22 12:06 ollyde

Can you provide your distribute_options file?

lijy91 avatar Jun 08 '22 14:06 lijy91

output: dist/
releases:
  - name: prod
    jobs:
      - name: release-macos
        package:
          platform: macos
          target: zip
          build_args:
            dart-define:
              APP_ENV: prod
      # See full documentation: https://distributor.leanflutter.org/configuration/makers/exe
      - name: release-windows
        package:
          platform: windows
          target: msix
          build_args:
            dart-define:
              APP_ENV: prod
      - name: release-ios
        jobs:
          - name: release-ios
            package:
              platform: ios
              target: ipa
              build_args:
                target: lib/main.dart
                export-options-plist: ios/ExportOptions.plist
            publish:
              target: appstore

Run with command flutter_distributor release --name prod --jobs release-ios

Getting a new error type 'Null' is not a subtype of type 'Map<String, dynamic>'

ExportOptions.plist looks like so

<?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">
<plist version="1.0">
<dict>
	<key>method</key>
	<string>app-store</string>
	<key>teamID</key>
	<string>J33N27XXX</string>
	<key>uploadBitcode</key>
	<true/>
	<key>compileBitcode</key>
	<true/>
	<key>uploadSymbols</key>
	<true/>
	<key>signingStyle</key>
	<string>manual</string>
	<key>signingCertificate</key>
	<string>iOS Distribution</string>
	<key>provisioningProfiles</key>
	<dict>
		<key>com.polydelic.testapp</key>
		<string>App Release</string>
	</dict>
</dict>
</plist>

ollyde avatar Jun 08 '22 16:06 ollyde

@ollyde is this still an issue for you or did you find a solution?

I've worked on improving docs/checks for this package on a command-line level.
I'd work on the config file based issues next when I find time. If this is still relevant to you, I could keep an eye on it while I'm at it.

cybrox avatar Feb 14 '23 14:02 cybrox

@cybrox i switched back to fastlane but I’ve got a task to revise this library as I don’t like fastlane and using a lib would be way better.

ollyde avatar Feb 14 '23 14:02 ollyde

Thanks for the feedback @ollyde!

I'll use this issue as an additional test case when working on it, then.

If you have to re-visit this before I get around to PR the changes... I finally switched our app over from fastlane last week, this is the config I'm using:

output: dist/

releases:
  - name: ios
    jobs:
      - name: ios-production
        package:
          platform: ios
          target: ipa
          build_args:
            export-options-plist: ./ios/Runner/Ipa-Export-Prod.plist
            flavor: prod  # only needed when using flavors
            dart-define:  # "
              ENV: prod   # "
        publish:
          target: appstore

cybrox avatar Feb 14 '23 15:02 cybrox

Don't understand why this simple config works locally on my PC:

output: dist/

releases:
  - name: release
    jobs:
      - name: linux-deb
        package:
          platform: linux
          target: deb

But throw an error in gitlab CI using ghcr.io/cirruslabs/flutter:stable docker image:

$ flutter --version
Flutter 3.19.4 • channel [user-branch] • unknown source
Framework • revision 68bfaea224 (3 days ago) • 2024-03-20 15:36:31 -0700
Engine • revision a5c24f538d
Tools • Dart 3.3.2 • DevTools 2.31.1
$ ls -la
total 124
drwxrwxrwx 15 root root  4096 Mar 24 02:25 .
drwxrwxrwx  4 root root  4096 Mar 24 01:26 ..
-rw-rw-rw-  1 root root    46 Mar 24 01:26 analysis_options.yaml
drwxrwxrwx  4 root root  4096 Mar 24 02:10 android
drwxrwxrwx  2 root root  4096 Mar 24 01:26 assets
drwxrwxrwx  2 root root  4096 Mar 24 01:26 config
-rw-rw-rw-  1 root root   249 Mar 24 02:25 distribute_options.yaml
drwxrwxrwx  6 root root  4096 Mar 24 02:25 .git
-rw-rw-rw-  1 root root   711 Mar 24 01:26 .gitignore
-rw-rw-rw-  1 root root  2026 Mar 24 02:22 .gitlab-ci.yml
drwxrwxrwx  7 root root  4096 Mar 24 01:26 ios
drwxrwxrwx  8 root root  4096 Mar 24 01:26 lib
drwxrwxrwx  4 root root  4096 Mar 24 01:26 linux
drwxrwxrwx  7 root root  4096 Mar 24 01:26 macos
-rw-rw-rw-  1 root root  1706 Mar 24 01:26 .metadata
-rw-rw-rw-  1 root root 34778 Mar 24 02:10 pubspec.lock
-rw-rw-rw-  1 root root  1030 Mar 24 01:26 pubspec.yaml
-rw-rw-rw-  1 root root    33 Mar 24 01:26 README.md
drwxrwxrwx  2 root root  4096 Mar 24 01:26 scripts
drwxrwxrwx  3 root root  4096 Mar 24 01:26 snap
drwxrwxrwx  2 root root  4096 Mar 24 01:26 .vscode
drwxrwxrwx  3 root root  4096 Mar 24 01:26 web
drwxrwxrwx  4 root root  4096 Mar 24 01:26 windows
$ cat distribute_options.yaml
output: dist/

releases:
  - name: release
    jobs:
      - name: linux-deb
        package:
          platform: linux
          target: deb

$ flutter_distributor release --name $CI_COMMIT_TAG
RELEASE FAILED in 0s
Exception: Missing/incomplete `distribute_options.yaml` file.
#0      FlutterDistributor.release (package:flutter_distributor/src/flutter_distributor.dart:297:9)
#1      CommandRelease.run (file:///root/.pub-cache/hosted/pub.dev/flutter_distributor-0.3.7/bin/command_release.dart:69:24)
#2      CommandRunner.runCommand (package:args/command_runner.dart:212:27)
#3      main (file:///root/.pub-cache/hosted/pub.dev/flutter_distributor-0.3.7/bin/main.dart:47:17)
<asynchronous suspension>
$ mv dist/*/*.deb "dist/gazelle-${CI_COMMIT_TAG}.deb"
mv: cannot stat 'dist/*/*.deb': No such file or directory
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1

poka-IT avatar Mar 24 '24 02:03 poka-IT

@poka-IT It seems that the value of $CI-COMMIT-TAG is not release

lijy91 avatar Mar 24 '24 10:03 lijy91

Yes, it was really stupid. Thank you for that.

poka-IT avatar Mar 24 '24 15:03 poka-IT