Fixing gir files manually as follows fixes the problem on my system, so this confirms that the bug is with these packages (libgranite-dev, gir1.2-granite-1.0).
$ sed -i -e 's/<namespace name/<namespace shared-library="libgranite.so.5.0" name/' /usr/share/gir-1.0/Granite-1.0.gir $ g-ir-compiler /usr/share/gir-1.0/Granite-1.0.gir >/usr/lib/x86_64-linux-gnu/girepository-1.0/Granite-1.0.typelib -- Ivan