From 63496a8e3bf61b7cf22404864760e07a150cdc11 Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Thu, 3 Sep 2026 09:41:54 +0200 Subject: [PATCH] Plugin-Schleife stuerzte ab: addSourceFile setzt eine Gruppe "Plugins" voraus Erster Lauf der neuen Schleife auf einem Mac. Sie brach ab mit "TypeError: Cannot read properties of null (reading 'path')" in correctForPluginsPath - addSourceFile() ohne Gruppe geht intern ueber addPluginFile, und das sucht eine Projektgruppe namens "Plugins". Ein Capacitor-Projekt hat die nicht, pbxGroupByName liefert null. Die Gruppe wird jetzt angelegt, falls sie fehlt. Sie ist reine Ablage im Navigator. Belegt am neu erzeugten Projekt: beide Plugin-Dateien mit Pfad App/.swift in der Sources-Phase des App-Ziels, neben AppDelegate und SceneDelegate. --- companion-app/scripts/ios-teilen-einrichten.mjs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/companion-app/scripts/ios-teilen-einrichten.mjs b/companion-app/scripts/ios-teilen-einrichten.mjs index 44a9024..b8d4335 100644 --- a/companion-app/scripts/ios-teilen-einrichten.mjs +++ b/companion-app/scripts/ios-teilen-einrichten.mjs @@ -142,7 +142,19 @@ projekt.parseSync() `addSourceFile` ohne Gruppe hängt die Datei an die ERSTE Sources-Phase des Projekts, und das ist die des App-Ziels - genau die richtige. (Mit Gruppe landete die Datei nur im Navigator; daran ist am 02.09.2026 die Erweiterung - ohne Programm entstanden, siehe unten.) */ + ohne Programm entstanden, siehe unten.) + + Ohne Gruppe geht `addSourceFile` intern über `addPluginFile`, und das legt + die Datei in eine Projektgruppe namens "Plugins". Ein Capacitor-Projekt hat + die nicht, `pbxGroupByName` liefert null, und das Skript stirbt mit + "Cannot read properties of null (reading 'path')" (03.09.2026). Die Gruppe + wird deshalb angelegt, falls sie fehlt - sie ist reine Ablage im Navigator + und ändert am Bau nichts. */ +if (!projekt.pbxGroupByName("Plugins")) { + projekt.addPbxGroup([], "Plugins", '""') + melden("Projektgruppe Plugins angelegt (von addSourceFile vorausgesetzt)") +} + let pluginsGeaendert = false for (const datei of PLUGIN_DATEIEN) { if (JSON.stringify(projekt.pbxSourcesBuildPhaseObj()).includes(datei)) {