Eas build error on Android (but works with expo build)

Hello, I have an error with eas build (android) :

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]    > Android resource compilation failed
[stderr]      /home/expo/workingdir/build/android/app/src/main/res/values/strings.xml:2:3-52: AAPT: error: unescaped apostrophe in string
[stderr]          
[stderr]      /home/expo/workingdir/build/android/app/src/main/res/values/strings.xml:2:3-52: AAPT: error: not a valid string.
[stderr]          
[stderr]      /home/expo/workingdir/build/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml: AAPT: error: file failed to compile.
[stderr]          
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan
[stderr] to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 5m 43s

expo diagnostics :

  Expo CLI 5.2.0 environment info:
    System:
      OS: Windows 10 10.0.19043
    Binaries:
      Node: 16.13.2 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.15 - S:\DEV\Tools\Yarn\bin\yarn.CMD
      npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
      Watchman: 4.9.4 - C:\Users\yoanl\AppData\Local\watchman\watchman.EXE
    npmPackages:
      @expo/webpack-config: ~0.16.2 => 0.16.15
      babel-preset-expo: 9.0.2 => 9.0.2
      expo: ^44.0.1 => 44.0.2
      react: 17.0.1 => 17.0.1
      react-dom: 17.0.1 => 17.0.1
      react-native: 0.64.3 => 0.64.3
      react-native-web: 0.17.1 => 0.17.1
    Expo Workflow: managed

No error with expo build.
Can someone tell me how I can debug this ?

Thanks !

Hi @visslar

Please can you post your app.json and package.json?

Sure !

app.json :

{
  "expo": {
    "name": "redacted",
    "slug": "redacted",
    "owner": "visslar",
    "version": "0.5.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "scheme": "com.xxx.yyy",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/icon.png",
      "resizeMode": "contain",
      "backgroundColor": "#133335"
    },
    "androidStatusBar": {
      "hidden": true
    },
    "androidNavigationBar": {
      "visible": "sticky-immersive"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "android": {
      "package": "com.xxx.yyy",
      "googleServicesFile": "./google-services.json",
      "config": {
        "googleMobileAdsAppId": "redacted"
      },
      "versionCode": 440000500,
      "permissions": [],
      "userInterfaceStyle": "light"
    },
    "ios": {
      "bundleIdentifier": "com.xxx.yyy",
      "supportsTablet": true,
      "buildNumber": "0.5.0",
      "userInterfaceStyle": "light",
      "infoPlist": {
        "Appearance": "Light",
        "UIUserInterfaceStyle": "Light"
      }
    },
    "web": {
      "favicon": "./assets/icon.png"
    },
    "experiments": {
      "turboModules": true
    },
    "plugins": [
      "sentry-expo"
    ],
    "hooks": {
      "postPublish": [
        {
          "file": "sentry-expo/upload-sourcemaps",
          "config": {
            "organization": "redacted",
            "project": "redacted",
            "authToken": "redacted",
            "setCommits": true
          }
        }
      ]
    }
  }
}

package.json

{
  "version": "0.5.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --watchAll",
    "generatei18n": "i18next"
  },
  "jest": {
    "preset": "jest-expo",
    "globals": {
      "ts-jest": {
        "isolatedModules": true
      }
    },
    "transformIgnorePatterns": [
      "node_modules/(?!moti)/"
    ],
    "setupFiles": [
      "./jest-setup.js"
    ]
  },
  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@mobily/stacks": "^1.4.1",
    "@react-native-async-storage/async-storage": "~1.15.0",
    "@react-native-community/checkbox": "^0.5.9",
    "@react-native-community/hooks": "^2.8.1",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "7.1.3",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/drawer": "^6.3.1",
    "@react-navigation/material-top-tabs": "^6.1.1",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/stack": "^6.1.1",
    "@types/react-test-renderer": "^17.0.1",
    "axios": "^0.26.0",
    "everpolate": "^0.0.3",
    "expo": "^44.0.6",
    "expo-ads-admob": "~12.0.0",
    "expo-application": "~4.0.1",
    "expo-asset": "~8.4.6",
    "expo-auth-session": "~3.5.0",
    "expo-av": "~10.2.0",
    "expo-community-flipper": "^44.0.1",
    "expo-constants": "~13.0.1",
    "expo-dev-client": "~0.8.4",
    "expo-device": "~4.1.0",
    "expo-font": "~10.0.4",
    "expo-google-app-auth": "~8.3.0",
    "expo-haptics": "~11.1.0",
    "expo-linear-gradient": "~11.0.3",
    "expo-linking": "~3.0.0",
    "expo-localization": "~12.0.0",
    "expo-navigation-bar": "~1.1.1",
    "expo-notifications": "~0.14.0",
    "expo-random": "~12.1.1",
    "expo-splash-screen": "~0.14.1",
    "expo-status-bar": "~1.2.0",
    "expo-system-ui": "~1.1.0",
    "expo-updates": "~0.11.6",
    "expo-web-browser": "~10.1.0",
    "fast-deep-equal": "^3.1.3",
    "firebase": "8.2.3",
    "i18next": "^21.6.11",
    "lodash": "^4.17.21",
    "lottie-react-native": "5.0.1",
    "mobx": "^6.4.1",
    "mobx-react": "^7.3.0",
    "mobx-utils": "^6.0.1",
    "moti": "^0.17.1",
    "react": "17.0.1",
    "react-devtools-core": "^4.22.1",
    "react-dom": "17.0.1",
    "react-freeze": "^1.0.0",
    "react-i18next": "^11.15.4",
    "react-native": "0.64.3",
    "react-native-appearance": "~0.3.3",
    "react-native-circular-progress": "^1.3.7",
    "react-native-draggable-flatlist": "^3.0.6",
    "react-native-fast-toast": "^3.0.1",
    "react-native-flipper": "^0.131.1",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-modal": "^13.0.0",
    "react-native-pager-view": "5.4.9",
    "react-native-particles": "^0.0.8",
    "react-native-popover-view": "^4.1.0",
    "react-native-reanimated": "~2.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-size-matters": "^0.4.0",
    "react-native-svg": "12.1.1",
    "react-native-svg-transformer": "^1.0.0",
    "react-native-swipeable-item": "^2.0.2",
    "react-native-tab-view": "^3.1.1",
    "react-native-tabs-section-list": "^1.0.1",
    "react-native-web": "0.17.1",
    "react-query": "^3.34.16",
    "sentry-expo": "^4.0.0",
    "styled-components": "^5.3.3",
    "throttle-debounce": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@expo/webpack-config": "~0.16.2",
    "@testing-library/react-native": "^9.0.0",
    "@types/i18next": "^13.0.0",
    "@types/jest": "^27.4.0",
    "@types/lodash": "^4.14.178",
    "@types/react": "~17.0.21",
    "@types/react-native": "~0.64.12",
    "@types/styled-components-react-native": "^5.1.3",
    "@types/throttle-debounce": "^2.1.0",
    "babel-preset-expo": "9.0.2",
    "jest": "^26.6.3",
    "jest-expo": "^44.0.0",
    "mobx-flipper": "^1.2.3",
    "prettier": "^2.5.1",
    "prettier-plugin-organize-imports": "^2.3.4",
    "react-devtools": "^4.8.2",
    "standard-version": "^9.3.2",
    "standard-version-expo": "^1.0.3",
    "type-fest": "^2.12.0",
    "typescript": "~4.3.5",
    "yarn": "^1.22.17"
  },
  "private": true
}

I also have a custom metro.config.js but disabling it doesn’t change the error.

Thanks.

I think you might have an apostrophe in one of those “redacted” strings

1 Like

You’re right, I have an apostrophe in the “name”. A huge thanks !

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.