[Bug]: Generated Android and iOS SPM plugin paths break with external virtual store
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java, javascript, nodejs, swift, typescript
- Área
- build-system, cli, mobile-dev
Línea de trabajo
The issue is in the path generation logic of the Capacitor CLI's update command for Android and iOS. Look at the code that writes capacitor.settings.gradle and ios/App/CapApp-SPM/Package.swift, likely in @capacitor/cli. The plugin.rootPath calculation needs to handle external virtual stores. Start by tracing how plugin paths are resolved in native-run.ts or the update utilities. Test with pnpm's global virtual store to verify the fix.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Capacitor Version
Installed Dependencies:
@capacitor/cli: 8.5.0
@capacitor/core: 8.5.0
@capacitor/android: 8.5.0
@capacitor/ios: 8.5.0
Other API Details
pnpm: 11.20.0
Node.js: 26.6.0
OS: macOS
@capacitor/cli: 8.5.0
@capacitor/android: 8.5.0
@capacitor/ios: 8.5.0
iOS package manager: Swift Package Manager
Platforms Affected
- iOS
- Android
- Web
Current Behavior
capacitor update generates native plugin paths that do not exist when dependencies use a virtual store outside the project.
One way to reproduce this is pnpm's global virtual store. With enableGlobalVirtualStore: true on pnpm 11.20, or virtualStoreType: global on newer pnpm versions, the physical dependency graph is stored outside the project.
Despite this, capacitor update android generates entries similar to:
project(':capacitor-app').projectDir = new File('../../../node_modules/.pnpm/@capacitor+app@.../node_modules/@capacitor/app/android')
Likewise, capacitor update ios with Swift Package Manager generates entries similar to:
.package(
name: "CapacitorApp",
path: "../../../../../node_modules/.pnpm/@capacitor+app@.../node_modules/@capacitor/app"
)
Under the global virtual-store layout, the project-local node_modules/.pnpm directory does not contain these packages. Consequently, Gradle and Swift Package Manager cannot resolve the generated plugin paths.
Switching back to pnpm's project-local virtual store, reinstalling dependencies, and rerunning capacitor update produces paths that exist and allows both native projects to resolve their dependencies.
The global virtual store is one concrete case where this breaks. More generally, generated paths appear to assume that a plugin's resolved package location can always be represented inside the project's local virtual store. Other symlinked or externally located dependency layouts may expose the same assumption.
Expected Behavior
Capacitor should generate Android Gradle and iOS SPM paths that resolve to the installed plugin directories, regardless of whether the package manager stores their physical contents inside or outside the project.
The generated files could reference stable project-level package symlinks or otherwise account for the physical package location. The exact representation is less important than ensuring every generated path exists.
Project Reproduction
Additional Information
Reproduction Steps
-
Create a Capacitor application using pnpm.
-
Add Android and iOS, configuring iOS to use Swift Package Manager.
-
Install at least one Capacitor plugin, for example
@capacitor/app. -
Enable pnpm's global virtual store:
# pnpm-workspace.yaml, pnpm 11.20 enableGlobalVirtualStore: trueOn newer pnpm versions, the equivalent setting is:
virtualStoreType: global -
Remove
node_modulesand reinstall:rm -rf node_modules pnpm install -
Regenerate the native dependency configuration:
pnpm exec cap update android pnpm exec cap update ios -
Inspect
android/capacitor.settings.gradleandios/App/CapApp-SPM/Package.swift. -
Observe that their generated
node_modules/.pnpm/...paths do not exist. -
Attempt to resolve or build either native project.
Additional Information
Android path generation calculates relative paths from each plugin's rootPath when writing capacitor.settings.gradle.
iOS SPM path generation similarly uses plugin.rootPath when writing CapApp-SPM/Package.swift.
A related historical report is #7081, but it was closed because no reproduction was provided and does not specifically cover pnpm's global virtual store.
- Lenguaje dominante
- TypeScript
- Estrellas
- 17.1k
- Forks
- 1.3k
- Merge medio
- 1 d 22 h
- PR fusionados (30 d)
- 26
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ionic-team/capacitor
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ionic-team/capacitor#8759 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Plugin call after navigation can be answered before reply proxy is updatedPosiblemente ocupada @MateStrysewske la tomó hace 71 días. Abiertotriage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ionic-team/capacitor#8616 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ionic-team/capacitor#8574 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
SystemBars: safe area CSS injection throws "Cannot read properties of null" on startup (Android 16)Posiblemente ocupada @kttalley la tomó hace 62 días. Abiertotriage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ionic-team/capacitor#8530 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
fix(android): remove unchecked Java compilation warningsPosiblemente ocupada @Ajamuar la tomó hace 15 días. Abiertotriage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ionic-team/capacitor#8529 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de ionic-team/capacitor
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
prio:low scope:world
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
OliverRomhagen/vrigstad-joyride#849 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
genfeedai/genfeed.ai#11916 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
erkamyaman/rust-anything#1153 ·
Los mantenedores suelen responder en 1 día
-
The Phase 5 report says 0.3.0 waits for the live checkPosiblemente ocupada @fzn0x la tomó hoy. Abiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día