Gradle Build Failing due to missing method Implementation()

34 Views Asked by At

For context :

  • I launch Bluestacks
  • Open command prompt
  • Run "cd %LocalAppData%\Android\sdk\platform-tools"
  • Run "adb connect localhost:5555"
  • cd to my project root folder
  • run "npx react-native start"

Then I open another command prompt once fully started and do the following :

  • cd to the project root folder
  • run "npx react-native run-android"

The build process runs for a bit but then stops with errors.

This is what My Command Prompt Looks like when I get my errors : " Microsoft Windows [Version 10.0.19042.685] (c) 2020 Microsoft Corporation. All rights reserved.

C:\Users\Kamal>cd C:\Users\Kamal\Desktop\Project

C:\Users\Kamal\Desktop\Project>npx react-native run-android warn Package @sentry/react-native contains invalid configuration: "dependency.platforms.ios.sharedLibraries" is not allowed,"dependency.hooks" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this. info JS server already running. info Installing the app...

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\Kamal\Desktop\Project\android\build.gradle' line: 25

  • What went wrong: A problem occurred evaluating root project 'Project'.

Could not find method implementation() for arguments [org.jetbrains.kotlin:kotlin-stdlib:1.6.0] 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. Get more help at https://help.gradle.org.

BUILD FAILED in 36s

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.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\Kamal\Desktop\Project\android\build.gradle' line: 25

  • What went wrong: A problem occurred evaluating root project 'Project'.

Could not find method implementation() for arguments [org.jetbrains.kotlin:kotlin-stdlib:1.6.0] 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. Get more help at https://help.gradle.org.

BUILD FAILED in 36s

at makeError (C:\Users\Kamal\Desktop\Project\node_modules\execa\index.js:174:9)
at C:\Users\Kamal\Desktop\Project\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\Kamal\Desktop\Project\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (C:\Users\Kamal\Desktop\Project\node_modules\@react-native-community\cli\build\index.js:108:9)

info Run CLI with --verbose flag for more details.

C:\Users\Kamal\Desktop\Project>"

I have tried changing "implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.0"" to "implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.0"" in the build.gradle file in the android folder.

I have tried changing classpath('com.android.tools.build:gradle:7.4.1') to classpath('com.android.tools.build:gradle:8.5') in the build.gradle file in the android folder.

I have tried pasting implementation "org.jetbrains.kotlin:kotlin-stdlib:1.6.0" into the build.gradle file in the app folder in the android folder.

However I still get these same errors.

0

There are 0 best solutions below