Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] run "flutter pub run msix:create" command with my own certificate errors #159

Closed
wxw-9527 opened this issue Nov 9, 2022 · 4 comments

Comments

@wxw-9527
Copy link

wxw-9527 commented Nov 9, 2022

ℹ️ Info

Version: ^3.7.0

💬 Description

PS W:\WorkSpace\RouXinPai\workpad> flutter pub run msix:create -v
[  +69 ms] executing: [W:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +78 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 6928314d505d2bb4777be05e45d7808a5aa91d2a
[   +1 ms] executing: [W:\flutter/] git tag --points-at 6928314d505d2bb4777be05e45d7808a5aa91d2a
[  +71 ms] Exit code 0 from: git tag --points-at 6928314d505d2bb4777be05e45d7808a5aa91d2a
[        ] 3.3.6
[  +46 ms] executing: [W:\flutter/] git rev-parse --abbrev-ref --symbolic @{upstream}
[  +42 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{upstream}
[        ] origin/stable
[        ] executing: [W:\flutter/] git ls-remote --get-url origin
[  +39 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +215 ms] executing: [W:\flutter/] git rev-parse --abbrev-ref HEAD
[  +45 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +68 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +65 ms] Using W:\flutter\.pub-cache for the pub cache.
[        ] executing: W:\flutter\bin\cache\dart-sdk\bin\dart __deprecated_pub run msix:create -v
[     0.014s] parsing cli arguments
[     0.118s] validating config values
[     0.126s] running "flutter build windows"...
[    10.986s] building msix files...
[    10.987s] validating build files
[    10.993s] cleaning temporary files
[    11.006s] create app icons
[    11.199s] copying VC libraries
[    11.206s] getting certificate publisher
[    11.207s] getting certificate "Subject" by file certificate
Unhandled exception:
FormatException: Unexpected extension byte (at offset 6)
#0      _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1859:7)
#1      _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:314:28)
#2      _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)
#3      _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)
#4      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#5      _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#8      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#9      _StreamController._add (dart:async/stream_controller.dart:648:7)
#10     _StreamController.add (dart:async/stream_controller.dart:596:5)
#11     _Socket._onData (dart:io-patch/socket_patch.dart:2324:41)
#12     _RootZone.runUnaryGuarded (dart:async/zone.dart:1586:10)
#13     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#14     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#15     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#16     _StreamController._add (dart:async/stream_controller.dart:648:7)
#17     _StreamController.add (dart:async/stream_controller.dart:596:5)
#18     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1849:33)
#19     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1322:14)
#20     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#21     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#22     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:122:13)
#23     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)
[+12463 ms] "flutter run" took 12,598ms.
[   +4 ms] pub finished with exit code 255
[        ]
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      _DefaultPub.interactively (package:flutter_tools/src/dart/pub.dart:418:7)
           <asynchronous suspension>
           #2      PackagesForwardCommand.runCommand (package:flutter_tools/src/commands/packages.dart:249:5)
           <asynchronous suspension>
           #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
           <asynchronous suspension>
           #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #5      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #6      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #7      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #8      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #9      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #10     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #11     main (package:flutter_tools/executable.dart:91:3)
           <asynchronous suspension>


[ +198 ms] ensureAnalyticsSent: 196ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[        ] exiting with code 255

📜 Pubspec.yaml

name: workpad
description: 柔信拍-生产工位看板(Windows版)

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1

environment:
  sdk: '>=2.18.0 <3.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter

  # 国际化
  flutter_localizations:
    sdk: flutter
  intl: ^0.17.0
  # SVG图像渲染
  flutter_svg: ^1.1.6
  # 依赖注入
  get_it: ^7.2.0
  # Dart Http请求库
  dio: ^4.0.6
  # 本地缓存
  shared_preferences: ^2.0.15
  # 状态管理
  bloc: ^8.1.0
  flutter_bloc: ^8.1.1
  # 路由
  go_router: ^5.1.1
  # 网络图片加载、缓存框架
  cached_network_image: ^3.2.2
  # 日志打印
  logger: ^1.1.0
  # flutter屏幕适配方案
  flutter_screenutil: ^5.6.0
  # Loading
  flutter_easyloading: ^3.0.5
  # 渲染HTML代码
  flutter_html: ^3.0.0-alpha.6
  # 自动调整文本大小
  auto_size_text: ^3.0.0
  # 计时器
  custom_timer: ^0.1.2
  # 应用程序包的信息
  package_info_plus: ^3.0.1

dev_dependencies:
  flutter_test:
    sdk: flutter

  # The "flutter_lints" package below contains a set of recommended lints to
  # encourage good coding practices. The lint set provided by the package is
  # activated in the `analysis_options.yaml` file located at the root of your
  # package. See that file for information about deactivating specific lint
  # rules and activating additional ones.
  flutter_lints: ^2.0.1
  # Windows应用程序打包
  msix: ^3.7.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/images/
    - assets/images/login/
    - assets/images/production/
    - assets/images/production/list/
    - assets/images/production/detail/
    - assets/images/production/detail/process/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

# 启用国际化插件
flutter_intl:
  enabled: true

msix_config:
  display_name: workpad
  msix_version: 1.0.0.0
  certificate_path: W:\WorkSpace\RouXinPai\workpad\windows\signature\WORKPAD.pfx
  certificate_password: *******

@wxw-9527
Copy link
Author

wxw-9527 commented Nov 9, 2022

I tried flutter pub run msix:create -v --signtool-options /f W:\WorkSpace\RouXinPai\workpad\windows\signature\WORKPAD.pfx /p "*****",but it was useless.

@YehudaKremer
Copy link
Owner

Hey, i will check it, thank you

@wxw-9527
Copy link
Author

wxw-9527 commented Nov 9, 2022

Thank you very much.

@enfyy
Copy link
Contributor

enfyy commented May 2, 2023

I have also encountered this problem. The issue seems to occur when the tool tries to obtain the publisher value from the certificate file.

I have created a pull request (#190) that describes my issue and proposes a fix.

YehudaKremer added a commit that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants