Hello,
I've tried to run ionic capacitor run android -l --external but found out that it calls capacitor add android even if android platform is already installed and configured (and it fails because, android in already installed).
Then I found that there is a checkForPlatformInstallation(platform: string) call that happens in the command pre-run
The problem is at this line, when we try to retrieve the capacitor integration root:
|
const integrationRoot = this.project.directory; |
in my case the capacitor integration root was overrided to point in a another subdirectory in ionic.config.json:
{
"defaultProject": "app-mobile",
"projects": {
"app-mobile": {
"name": "App mobile",
"type": "angular",
"id": "MY_ID",
"npmClient": "yarn",
"root": "apps/app-mobile",
"integrations": {
"capacitor": {
"root": "integrations/app-mobile/capacitor"
}
}
}
}
}
I think that the capacitor integration root should be retrieve this way:
const integrationRoot = this.project.getIntegration('capacitor').root;
It looks like to work in both case, when root is overrided or not.
I don't know if we must replace the others calls to this.project.directory in the ionic-cli/packages/@ionic/cli/src/commands/capacitor/base.ts file ?
Let me know if you're interrested in a pull request with a fix.
Thanks !
Hello,
I've tried to run
ionic capacitor run android -l --externalbut found out that it callscapacitor add androideven ifandroidplatform is already installed and configured (and it fails because, android in already installed).Then I found that there is a
checkForPlatformInstallation(platform: string)call that happens in the command pre-runThe problem is at this line, when we try to retrieve the capacitor integration root:
ionic-cli/packages/@ionic/cli/src/commands/capacitor/base.ts
Line 120 in 28d8540
in my case the capacitor integration root was overrided to point in a another subdirectory in
ionic.config.json:I think that the capacitor integration root should be retrieve this way:
It looks like to work in both case, when root is overrided or not.
I don't know if we must replace the others calls to
this.project.directoryin theionic-cli/packages/@ionic/cli/src/commands/capacitor/base.tsfile ?Let me know if you're interrested in a pull request with a fix.
Thanks !