YehudaKremer / msix

Create Msix installer for flutter windows-build files.
https://pub.dev/packages/msix
MIT License
280 stars 70 forks source link

[BUG] Bad state no element #61

Closed ghost closed 3 years ago

ghost commented 3 years ago

:information_source: Info

Version: 2.6.1

:speech_balloon: Description

Since upgrade from 2.5..4 to 2.6.1 i got the following error : Bad state no element :

[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% parsing cli arguments..
[10:34:49]: ▸ ☑ parsing cli arguments
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 7% validating config values..
[10:34:49]: ▸ ☑ validating config values
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 14% cleaning temporary files..
[10:34:49]: ▸ ☑ cleaning temporary files
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 21% copying assets folder..
[10:34:49]: ▸ ☑ copying assets folder
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 28% creating app icons folder..
[10:34:49]: ▸ ☑ creating app icons folder
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 35% copying app icons..
[10:34:49]: ▸ ☑ copying app icons
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 42% copying VC libraries..
[10:34:49]: ▸ ☑ copying VC libraries
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 50% getting certificate publisher..
[10:34:49]: ▸ [❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 50% getting certificate publisher..                                     Certificate Details: ==
============== Certificat 0 ================
[10:34:49]: ▸ ================ Commencement de l’imbrication au niveau 1 ================
[10:34:49]: ▸ Élément 0 :
[10:34:49]: ▸ Numéro de série : 05beb48eCENSORED_FOR_GITHUB2f7
[10:34:49]: ▸ Émetteur: O=CENSORED_FOR_GITHUB, S=France, C=FR
[10:34:49]: ▸ NotBefore : 20/10/2021 10:14
[10:34:49]: ▸ NotAfter : 07/03/2049 10:14
[10:34:49]: ▸ Objet: O=CENSORED_FOR_GITHUB, S=France, C=FR
[10:34:49]: ▸ La signature correspond à la clé publique
[10:34:49]: ▸ Certificat racine : le sujet correspond à l’émetteur
[10:34:49]: ▸ Hach. cert. (sha1) : 275f5CENSORED_FOR_GITHUB0cbf24f
[10:34:49]: ▸ ----------------  Fin de l’imbrication au niveau 1  ----------------
[10:34:49]: ▸ Fournisseur = Microsoft Enhanced Cryptographic Provider v1.0
[10:34:49]: ▸ Succès du test de chiffrement
[10:34:49]: ▸ CertUtil: -dump La commande s’est terminée correctement.
[10:34:49]: ▸
[10:34:49]: ▸ Bad state: No element
[10:34:49]: ▸ This error happen when this package tried to read the certificate details,
[10:34:49]: ▸ please report it by pasting all this output (after deleting sensitive info) to:
[10:34:49]: ▸ https://github.com/YehudaKremer/msix/issues
[10:34:49]: ▸ #0      ListMixin.lastWhere (dart:collection/list.dart:180:5)
[10:34:49]: ▸ #1      Signtool.getCertificatePublisher (package:msix/src/cli/signtool.dart:34:12)
[10:34:49]: ▸ #2      Signtool.getCertificatePublisher (package:msix/src/cli/signtool.dart:44:22)
[10:34:49]: ▸ #3      Msix.createMsix (package:msix/msix.dart:29:16)
[10:34:49]: ▸ <asynchronous suspension>

:scroll: Pubspec.yaml

  msix: 2.6.1

msix_config:
  display_name: "My flutter app"
  publisher_display_name: CONSORED_FOR_GITHUB
  identity_name:  CONSORED_FOR_GITHUB.WindowsApp
  logo_path: assets/images/icon.png
  vs_generated_images_folder_path: assets/images
  # Permissions are here : location,microphone,webcam'
  capabilities: 'internetClient'

In addition i run the following command :

flutter pub run msix:create -o ENV['APP_FILE_PATH'] -n ENV['APP_NAME'] -c ENV['MSIX_CERTIFICATE_PATH'] -p ENV['MSIX_CERTIFICATE_PASSWORD'] -b ENV['MSIX_CERTIFICATE_PUBLISHER'] -v 1.0.0.0
ghost commented 3 years ago

In addition of this issue :

Command line return True on windows so my CI-CD didn't detect that command line failed, it's important to make a return code different like False or -1.

YehudaKremer commented 3 years ago

@EA-YOUHOU Thank you for this report

I fixed the two problems you mention here and publish new version 2.6.2

please try it

YehudaKremer commented 3 years ago

and @EA-YOUHOU

You can omit the -b ENV['MSIX_CERTIFICATE_PUBLISHER'] part, the "publisher" is recognize automatically

ghost commented 3 years ago

INSANE, well played :) ! It works well