ITMS-90038: Malformed InfoPlist.strings file: '${filePath}' when publishing app using expo

Viewed 342

I'm using expo to build my react native app, and i need to add localization to my app, but whenever i upload my IPA using transporter, i get the following error "ITMS-90038: Malformed InfoPlist.strings file: '${filePath}'". Here's my app.json:

{
  "expo": {
    "name": "MYAPP",
    "slug": "MYAPP",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    "version": "1.0.3",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "bundleIdentifier": "com.my.MYAPP",
      "buildNumber": "1.0.3",
      "supportsTablet":true,
      "infoPlist": {
        "CFBundleAllowMixedLocalizations": true
      }
    },
    "locales": {
      "en": "./constants/en.json",
      "pt": "./constants/pt.json"
    },
    "android": {
      "package": "com.my.MYAPP",
      "versionCode": 3,
      "intentFilters": [
        {
          "action": "VIEW",
          "data": [
            {
              "scheme": "https",
              "host": "*.myapp.com",
              "pathPrefix": "/OAuth"
            }
          ],
          "category": [
            "BROWSABLE",
            "DEFAULT"
          ]
        }
      ]
    },
    "description": ""

  }
}

and here are my pt.json and en.json files:

{   //pt.json
    "CFBundleDisplayName": "MYAPP",
    "NSCameraUsageDescription": "\"MYAPP\" gostaria de aceder à sua câmera, para poder adicionar uma imagem ao seu perfil ou a uma ocorrência",
    "NSPhotoLibraryAddUsageDescription": "\"MYAPP\" gostaria de poder guardar imagens" ,
    "NSPhotoLibraryUsageDescription": "\"MYAPP\" gostaria de aceder às suas imagens, para poder adicionar uma imagem ao seu perfil ou a uma ocorrência"
}
{   //en.json
    "CFBundleDisplayName": "MYAPP",
    "NSCameraUsageDescription": "\"MYAPP\" would like to access your camera, in order to add an image to your profile or to an occurrence",
    "NSPhotoLibraryAddUsageDescription": "\"MYAPP\" would like to save images" ,
    "NSPhotoLibraryUsageDescription": "\"MYAPP\" would like to access your photos, in order to add an image to your profile or to an occurrence"
}

Is there any other type of setting up that i need to do? Or do i have any type of error in my code?

1 Answers

The issue come from the \", expo use app.json to create Info.plist.

To see how expo create this file you can run expo prebuild to generate the native code of your project and check the result of Info.plist.

In en.json:

{
    ...
    "NSCameraUsageDescription": "\"MYAPP\" would like to access your camera, in order to add an image to your profile or to an occurrence",
    ...
}

Resulting in ./ios/MYAPP/Supporting/en.lproj/InfoPlist.strings

...
NSCameraUsageDescription = ""MYAPP" would like to access your camera, in order to add an image to your profile or to an occurrence";
...
Related