Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expo-build-properties doesn't set up Gradle properties and iOS doesn't build the app #26572

Open
1 of 4 tasks
guillempuche opened this issue Jun 16, 2024 · 2 comments
Open
1 of 4 tasks
Assignees
Labels
scope: react-native Issues relating to React Native type: bug

Comments

@guillempuche
Copy link

Current Behavior

I create a blank Expo project with Nx create with this package https://github.com/guillempuche/test-nx-expo/blob/main/apps/expo/package.json (Emily already fixed a problem #26285 (comment)).

When @nx/expo installs expo-build-properties and then runs the Expo app with Expo properties configured https://docs.expo.dev/versions/latest/sdk/build-properties/, Gradle doesn't apply the configuration.

iOS Pod file has the property in ios/Podfile.properties.json, but there's an error building the app on iOS simulator.

Expo build properties are found at apps/expo/app.json https://github.com/guillempuche/test-nx-expo/blob/main/apps/expo/app.json#L46:

      [
        "expo-build-properties",
        {
          "android": {
            "compileSdkVersion": 34,
            "minSdkVersion": 26,
            "targetSdkVersion": 34
          },
          "ios": {
            "deploymentTarget": "13.4"
          }
        }
      ]

Expected Behavior

  • Package expo-build-properties is added to package.json
  • Android app builds with Gradle properties in android/gradle.properties compileSdkVersion and minSdkVersion
  • iOS app builds

GitHub Repo

https://github.com/guillempuche/test-nx-expo/

Steps to Reproduce

  1. npm i
  2. npm exec nx run expo:install expo-build-properties
  3. Android npm exec nx run expo:run-android and iOS `npm exec nx run expo:run-ios
  4. Nx doesn't sync expo-build-properties to app's package.json neither build the app successfully.

Nx Report

Node   : 20.14.0
OS     : darwin-arm64
npm    : 10.7.0

nx                 : 19.2.3
@nx/js             : 19.2.3
@nx/jest           : 19.2.3
@nx/linter         : 19.2.3
@nx/eslint         : 19.2.3
@nx/workspace      : 19.2.3
@nx/detox          : 19.2.3
@nx/devkit         : 19.2.3
@nx/eslint-plugin  : 19.2.3
@nx/expo           : 19.2.3
@nx/react          : 19.2.3
@nrwl/tao          : 19.2.3
@nx/web            : 19.2.3
@nx/webpack        : 19.2.3
typescript         : 5.3.3
---------------------------------------
Registered Plugins:
@nx/expo/plugin
@nx/eslint/plugin
@nx/jest/plugin
@nx/detox/plugin

Failure Logs

No response

Package Manager Version

npm 10.7.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@guillempuche guillempuche changed the title expo-build-properties is expo-build-properties doesn't set up Gradle properties and iOS doesn't build the app Jun 16, 2024
@FrozenPandaz FrozenPandaz added the scope: react-native Issues relating to React Native label Jun 24, 2024
@xiongemi
Copy link
Collaborator

xiongemi commented Jul 5, 2024

you can run command npx nx install expo --packages=expo-build-properties and it should add expo-build-properties to your project's package.json

I have #26500 to add the project's package.json when doing nx install command. it should be in 19.4.0

@guillempuche
Copy link
Author

Good improvement because Expo recommends to use expo install as much as possible.

I run the command but doesn't find the plugin settings at https://github.com/guillempuche/test-nx-expo/blob/main/apps/expo/app.json.

npx nx install expo --packages=expo-build-properties 

> nx run expo:install --packages=expo-build-properties

› Installing 1 SDK 51.0.0 compatible native module using npm
> npm install

up to date, audited 2211 packages in 2s

246 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

No Expo config was found. Please create an Expo config (app.json or app.config.js) in your project root.
Please add the following to your Expo config

{
  "plugins": [
    "expo-build-properties"
  ]
}


——————————————————————————————————————————————————————————————————————————————————————

 NX   Successfully ran target install for project expo (3s)

      With additional flags:
        --packages=expo-build-properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

No branches or pull requests

3 participants