-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Capacitor Version
Capacitor comes as a transitive dependency of https://github.com/ionic-team/ionic-portals-react-native
COCOAPODS: 1.16.2
➜ ios git:(master) ✗ cat Podfile.lock | grep Capacitor
- Capacitor (7.0.1):
- CapacitorCordova
- CapacitorCordova (7.4.4)
- Capacitor (~> 7.0.0)
- Capacitor
- CapacitorCordova
Capacitor: 7b6faa2a912c47313a231c76363a863cea0c6123
CapacitorCordova: 1a2fefa999c426f71c4bb5cd7a787ffc6fd4ec3s
Other API Details
cat package.json | grep ionic
"@ionic/portals-react-native": "^0.8.3",
The app is using Expo framework and React Native's `privacy_file_aggregation_enabled` feature.Platforms Affected
- iOS
- Android
- Web
Current Behavior
After adding portals dependency (npx expo install @ionic/portals-react-native), the application build starts failing with following error.
❌ error: Multiple commands produce '/Users/<user>/Library/Developer/Xcode/DerivedData/<app-name>-bygnknwtcxmavsasyyxjtmjwoich/Build/Products/Debug-iphoneos/<app-name>.app/PrivacyInfo.xcprivacy'
The reason for this is that capacitor (3rd party dependency) is shipping its PrivacyInfo.xcprivacy manifest in resources instead of resource_bundles. Capacitor copies it's manifest into main bundle root and React Native can no longer create final aggregated manifest during the build.
These are two problematic places:
- https://github.com/ionic-team/capacitor/blob/main/ios/Capacitor.podspec#L20
- https://github.com/ionic-team/capacitor/blob/main/ios/CapacitorCordova.podspec#L23
Some more context from Grok
s.resources: Files copied directly into the app's main bundle root. PrivacyInfo.xcprivacy lands at top level → conflicts with Expo's aggregation → error.
s.resource_bundles: Files placed inside a separate .bundle (here Capacitor.bundle). Privacy manifest goes into the bundle → CocoaPods/Expos privacy aggregation can find and merge it correctly → no error.
Use resource_bundles is required for privacy manifest aggregation in Xcode 15+/iOS 17+. resources no longer work
Expected Behavior
I expect @ionic/portals-react-native to work with Expo framework.
Project Reproduction
npx create-expo-app@latest
npx expo install @ionic/portals-react-native
npx expo install expo-build-properties
switch to static linking
diff --git a/app.json b/app.json
index fa520a5..72bc43e 100644
--- a/app.json
+++ b/app.json
@@ -9,7 +9,8 @@
"userInterfaceStyle": "automatic",
"newArchEnabled": true,
"ios": {
- "supportsTablet": true
+ "supportsTablet": true,
+ "bundleIdentifier": "com.anonymous.my-app"
},
"android": {
"adaptiveIcon": {
@@ -38,6 +39,14 @@
"backgroundColor": "#000000"
}
}
+ ],
+ [
+ "expo-build-properties",
+ {
+ "ios": {
+ "useFrameworks": "static"
+ }
+ }
]
],
"experiments": {
now build the app
npx expo run:ios --device
...
❌ error: Multiple commands produce ...
Additional Information
No response