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

@nrwl/react-native - Android build issues when setting "deviceId" in project.json #16090

Closed
omniviewsports opened this issue Apr 4, 2023 · 2 comments
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@omniviewsports
Copy link

omniviewsports commented Apr 4, 2023

Current Behavior

apps/client/mobile/project.json

"run-android": {
"executor": "@nrwl/react-native:run-android",
"options": {
"deviceId": "Pixel_5_API_33"
}
},

Output

❯ yarn run:android
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed in 0s 577ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 1s 251ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 0s 743ms
➤ YN0000: Done in 2s 687ms

nx run client-mobile:run-android

info Dependencies for 'client-mobile' are up to date! No changes made.
JS server already running.
error: unknown option '--device-id'
(Did you mean --deviceId?)

NX 1

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

NX Ran target run-android for project client-mobile (2s)

✖    1/1 failed
✔    0/1 succeeded [0 read from cache]

View structured, searchable error logs at https://nx.app/runs/6UKhc58c37

Web capture_4-4-2023_121919_cloud nx app

Expected Behavior

setting deviceId for android in project.json does not result in an error.Android

GitHub Repo

No response

Steps to Reproduce

  1. In your react-native app's project.json, set "run-android" with the following options:
    "run-android": {
    "executor": "@nrwl/react-native:run-android",
    "options": {
    "deviceId": "Pixel_5_API_33"
    }
    },

  2. Open a first terminal window

  3. navigate to the root of your nx monorepo

  4. Start Metro server in the first terminal window using "nx start "

  5. Open a second terminal window

  6. navigate to the root of your nx monorepo

  7. Run Android using "nx run-android "

Nx Report

Node : 18.15.0
   OS   : darwin x64
   yarn : 3.5.0

   nx                      : 15.9.2
   @nrwl/js                : 15.9.2
   @nrwl/jest              : 15.9.2
   @nrwl/linter            : 15.9.2
   @nrwl/workspace         : 15.9.2
   @nrwl/cli               : 15.9.2
   @nrwl/detox             : 15.9.2
   @nrwl/devkit            : 15.9.2
   @nrwl/eslint-plugin-nx  : 15.9.2
   @nrwl/express           : 15.9.2
   @nrwl/nest              : 15.9.2
   @nrwl/node              : 15.9.2
   @nrwl/react             : 15.9.2
   @nrwl/react-native      : 15.9.2
   @nrwl/tao               : 15.9.2
   @nrwl/web               : 15.9.2
   @nrwl/webpack           : 15.9.2
   @nrwl/nx-cloud          : 15.3.5
   typescript              : 5.0.3

Failure Logs

Additional Information

{
"name": "client-mobile",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/client/mobile/src",
"projectType": "application",
"targets": {
"start": {
"executor": "@nrwl/react-native:start",
"options": {
"port": 8081,
"resetCache": true
}
},
"serve": {
"executor": "nx:run-commands",
"options": {
"command": "nx start mobile"
}
},
"run-ios": {
"executor": "@nrwl/react-native:run-ios",
"options": {
"simulator": "iPhone 14 Pro",
"install": true
}
},
"bundle-ios": {
"executor": "@nrwl/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"platform": "ios",
"bundleOutput": "dist/apps/client/mobile/ios/main.jsbundle"
}
},
"run-android": {
"executor": "@nrwl/react-native:run-android",
"options": {
"deviceId": "Pixel_5_API_33"
}
},
"build-android": {
"executor": "@nrwl/react-native:build-android",
"outputs": [
"{projectRoot}/android/app/build/outputs/bundle",
"{projectRoot}/android/app/build/outputs/apk"
],
"options": {}
},
"bundle-android": {
"executor": "@nrwl/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"platform": "android",
"bundleOutput": "dist/apps/client/mobile/android/main.jsbundle"
}
},
"sync-deps": {
"executor": "@nrwl/react-native:sync-deps",
"options": {}
},
"ensure-symlink": {
"executor": "@nrwl/react-native:ensure-symlink",
"options": {}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/client/mobile/**/*.{ts,tsx,js,jsx}"]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/client/mobile/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"build-ios": {
"executor": "@nrwl/react-native:build-ios",
"outputs": ["{projectRoot}/ios/build/Build"],
"options": {}
},
"pod-install": {
"executor": "@nrwl/react-native:pod-install",
"options": {}
}
},
"tags": []
}

@xiongemi
Copy link
Collaborator

create a pr #16410 to fix this. it should be fixed in the next release. closing this issue

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

No branches or pull requests

3 participants