ionic-frameworkionic-appflow

Ionic Appflow/Bitbucket - Error when building an app including subrepository - Cannot load subrepo


I just started with Ionic Appflow and read all the docs and introductions. When I want to start a build for my latest bitbucket commit, I get an error from the build process because it cannot load the submodule included:

Please make sure you have the correct access rights
and the repository exists.

The main repository is successfully linked to the app, but there seems to be a problem while loading a submodule. My ionic app project consists of individual stuff and a kind of "base" template which i built and which is included as submodule in the repository. Fetching the repo with

git clone git@bitbucket.org:examplecompany/exampleapp.git --recursive

is working well and also loads all files from the submodule.

Ionic Appflow doesn't seem to allow submodules in repositories due to the error give. Has anybody encountered the same issue or a solution for this problem? Best regards!

EDIT : I just tried to include the subrepo as a git subtree instead of a git submodule into the main repository and this works pretty well and appflow also recognizes the submodule this way and the build passes. I think subtree isn't a nice solution because the files are being stored in the main repo and not just linked like with the submodule. So I'm still looking for a submodule solution for my problem! Thanks


Solution

  • I found a solution for the problem. It seemed to be a problem with capacitor 2 and AndroidX. By adding the following lines to your package.json and .npmrc the build process works:

    Edit your package.json and add the following lines:

    Add these cordova plugins to your dependencies:

      "cordova-plugin-androidx": "^3.0.0",
      "cordova-plugin-androidx-adapter": "^1.1.1",
    

    Add the following line to the script section:

     "scripts": {
            "postinstall": "npx jetify"
        },
    

    After Editing package.json:

    Create a file called ".npmrc" in the root of your project with the following contents:

    unsafe-perm=true
    

    Now you can commit your changes and the android build in Ionic Appflow passes!

    Hope that this will help someone in the future!