ionic-team / ionic-team/ionic-cli

Wrong Info.plist generated by disableAppTransportSecurity

Abierto
#5,090 1 comentario 2 reacciones 0 asignados Ver en GitHub
triage
Lenguaje dominante
TypeScript
Estrellas
2k
Forks
682
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Description:**
The Info.plist generated by the command `ionic capacitor run ios -l` is incorrect and prevents Xcode from building the app if the key `NSAppTransportSecurity` is already defined.
The issue started after updating to Xcode 15.2. Previous versions like 14 work as expected.

**Steps to Reproduce:**
1. Create an ionic app with iOS support
2. Add the following configurations to the Info.plist file:

```
NSAppTransportSecurity

NSExceptionDomains

facebook.com

NSIncludesSubdomains

NSThirdPartyExceptionRequiresForwardSecrecy




```
3. Run the app with the command ionic capacitor run ios -l.

**Output:**
The Xcode build fails with the following error:
```
[capacitor] error: unable to read property list from file: /Volumes/Projects/xxx/ios/App/App/Info.plist: The operation couldn’t be completed. (XCBUtil.PropertyListConversionError error 2.) (in target 'App' from project 'App')
```

**My `ionic info`:**

```
Ionic:

Ionic CLI : 6.20.9
Ionic Framework : @ionic/react 6.7.5

Capacitor:

Capacitor CLI : 6.0.0
@capacitor/android : 6.0.0
@capacitor/core : 6.0.0
@capacitor/ios : 6.0.0

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.13.1 (/Users/xxxx/.nvm/versions/node/v20.13.1/bin/node)
npm : 10.5.2
OS : macOS Unknown
```

**Other Information:**
The problem is in the disableAppTransportSecurity method in https://github.com/ionic-team/ionic-cli/blob/%40ionic/cli%407.2.0/packages/%40ionic/cli/src/lib/integrations/capacitor/ios.ts

Line 45 adds the true value without adding NSAllowsArbitraryLoads key.

As a workaround I added the default values to the Info.plist in the NSAppTransportSecurity dict:
```
NSAllowsArbitraryLoads

```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.