brunolemos / react-native-web-monorepo

Code sharing between iOS, Android & Web using monorepo
https://dev.to/brunolemos/tutorial-100-code-sharing-between-ios-android--web-using-react-native-web-andmonorepo-4pej
865 stars 175 forks source link

Unable to run android: yarn android #41

Closed slgauravsharma closed 3 years ago

slgauravsharma commented 4 years ago

Unable to run android: yarn run android yarn android yarn run v1.21.1 $ yarn workspace mobile android $ react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 0 file(s) to forward-jetify. Using 8 workers... info Starting JS server... info Installing the app... :ReactNative:Passing custom root is deprecated. CLI detects root automatically now. :ReactNative:Please remove second argument toapplyNativeModulesSettingsGradle`.

Configure project :app :ReactNative:Passing custom root is deprecated. CLI detects root automatically now :ReactNative:Please remove second argument to applyNativeModulesAppBuildGradle.

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

BUILD FAILED in 2s

at checkExecSyncError (child_process.js:616:11)
at execFileSync (child_process.js:634:13)
at runOnAllDevices (/home/xavient/My/my/React Native/react-native-web-monorepo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:39)
at buildAndRun (/home/xavient/My/my/React Native/react-native-web-monorepo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at then.result (/home/xavient/My/my/React Native/react-native-web-monorepo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed. Exit code: 1 Command: /usr/bin/node Arguments: /usr/share/yarn/lib/cli.js android Directory: /home/xavient/My/my/React Native/react-native-web-monorepo/packages/mobile Output:

info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. `

AdamMescher commented 4 years ago

sI was able to get it working by updating the two calls of applyNativeModulesSettingsGradle in build.gradle and settings.gradle by removing the second argument.

settings.gradle line 211

applyNativeModulesSettingsGradle(settings)

build.grade line 2

applyNativeModulesAppBuildGradle(project)