flutter_distributor icon indicating copy to clipboard operation
flutter_distributor copied to clipboard

MakeError: type 'Null' is not a subtype of type 'String' in type cast

Open Fenekhu opened this issue 11 months ago • 2 comments

While trying to build a linux AppImage, I get the following error:

MakeError: type 'Null' is not a subtype of type 'String' in type cast
#0      AppPackageMakerAppImage._make (package:flutter_app_packager/src/makers/appimage/app_package_maker_appimage.dart:296:7)
<asynchronous suspension>
#1      UnifiedDistributor.package (package:unified_distributor/src/unified_distributor.dart:197:35)
<asynchronous suspension>
...

It seems like I'm missing something, but I can't tell what based on the line that it gave me. (Side note, capturing every unexpected error and just taking the string feels very strange to me for this exact reason, that now I have no idea how to tell where exactly anything went wrong).

Here is the job in the distribute_options.yaml that creates it:

- name: linux-appimage
  package:
    platform: linux
    target: appimage

Here is the make_config.yaml: (the actual app name has been replaced with "My App", etc)

display_name: My App

icon: assets/images/icon.png

keywords:
  - Music
  - Player

generic_name: My App

actions: []

categories:
  - Music

startup-notify: true

# im not sure what difference manually specifying this makes.
include:
  - libmpv.so.2

metainfo: linux/packaging/com.fenekhu.my_app.appdata.xml

Fenekhu avatar Apr 02 '25 04:04 Fenekhu

Update: it seems to have been caused by

include:
  - libmpv.so.2

Removing those lines, it works now. I just hope the app image works fine without it.

As for what exactly is wrong with those lines... that is a great question. Since that's still an open question, I'm going to leave this Issue open for now.

Fenekhu avatar Apr 02 '25 04:04 Fenekhu

Affected by the same issue. I guess this is reproducible as soon as we specify a library in include.

G-Ray avatar Apr 09 '25 11:04 G-Ray