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

[React-Native] Android - build.gradle: could not find method compile() for arguments #75

Open
tungxuan1656 opened this issue Nov 4, 2022 · 2 comments

Comments

@tungxuan1656
Copy link

Gặp lỗi khi build android
"react-native": "0.68.2",
"react-native-momosdk": "^1.4.3",

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: /Users/tungxuan/Projects/ReactNative/tngo/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/tungxuan/Projects/ReactNative/tngo/node_modules/react-native-momosdk/android/build.gradle' line: 34

  • What went wrong:
    A problem occurred evaluating project ':react-native-momosdk'.

Could not find method compile() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 18s

at makeError (/Users/tungxuan/Projects/ReactNative/tngo/node_modules/execa/index.js:174:9)
at /Users/tungxuan/Projects/ReactNative/tngo/node_modules/execa/index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (/Users/tungxuan/Projects/ReactNative/tngo/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/tungxuan/Projects/ReactNative/tngo/node_modules/@react-native-community/cli/build/index.js:192:9)

info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@tungxuan1656
Copy link
Author

Do you have any updates?

@nhhai1605
Copy link

I think you can just simply change the compile to implementation https://stackoverflow.com/a/66910991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants