Build error due to private git submodules


We want to adopt Capacitor and AppFlow for our mobile apps and bumped into a build issue. We use a private repo that contains a private submodule. The build fails when trying to fetch the submodule.

Cloning repository...
Cloning into '/builds/foo/bar'...
Checking out 1a5570e6 as task/APPS-760-config...
Updating/initializing submodules...
Submodule 'tf' ( registered for path 'tf'
Cloning into '/builds/foo/bar/tf'...
Host key verification failed.
fatal: Could not read from remote repository.

Is there a way we can make this work? It’s a monorepo and the mobile build doesn’t actually need the submodule to be present. Either of the following would work for us:

  • Submodules can be fetched.
  • Submodules are ignored.


Yes, see the Appflow docs on using private git submodules.

Thanks but I did not understand that documentation page. It says to add the submodule with a relative path. But how will AppFlow know what is the actual remote URL of the submodule?

If I do:

git rm --cached tf     
git submodule add ../tf.git

I end up with:

Which is most likely not what I want, right?

Hi @hierfoods,

Using a relative URL should be possible with a submodule as described in the documentation, though I have also seen this done with an absolute URL instead that includes the username and auth token. Here is a quick example of this option:


More information on this can be found in this Appflow documentation on using private git repositories

If you have any additional questions, please do reach out to Appflow support for further assistance. Thanks!

1 Like

Using a relative path for the submodule worked. Thanks!

1 Like