Plugin with id 'maven' not found. react native

React Native image maven Ocr Text

I am creating an app using the react-native-tessract-ocr module after installing the module getting this error 


FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/username/Projects/RNOcr/node_modules/react-native-tesseract-ocr/android/build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
> Plugin with id 'maven' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 13s
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
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file '/Users/username/Projects/RNOcr/node_modules/react-native-tesseract-ocr/android/build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-tesseract-ocr'.
> Plugin with id 'maven' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-tesseract-ocr'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 13s
    at makeError (/Users/username/Projects/RNOcr/node_modules/execa/index.js:174:9)
    at /Users/username/Projects/RNOcr/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async runOnAllDevices (/Users/username/Projects/RNOcr/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/username/Projects/RNOcr/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Executing Gradle tasks as part of a build without a settings file is not supported. Make sure that you are executing Gradle from a directory within your Gradle project. Your project should have a 'settings.gradle(.kts)' file in the root directory.
* 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 3s


Solutions (1)
  • Code Solution 2 years, 8 months, 3 weeks, 1 day, 10 hours, 58 minutes ago

    To summarise for those running into this issue:

    Change gradle build tools in the main build.gralde to:
    classpath 'com.android.tools.build:gradle:4.2.2'

    Change distribution url in the yourproject/gradle/wrapper/gradle-wrapper.properties file to:
    distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-all.zip

    The jump between the 7.0 version and the versions mentioned above is so huge because they are aligning the version numbers with the Gradle version number. The versions mentioned above just before the 7.0 versions.

    https://github.com/expo/expo/issues/12774


Your Answer To Login
Add Answer