Giter Site home page Giter Site logo

Execution failed for task ':react-native-clipboard_clipboard:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. about clipboard HOT 19 OPEN

react-native-clipboard avatar react-native-clipboard commented on May 23, 2024 12
Execution failed for task ':react-native-clipboard_clipboard:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.

from clipboard.

Comments (19)

Princejain21 avatar Princejain21 commented on May 23, 2024 3

I followed below steps which solved my problem.

  1. go to this file.
    node_modules@react-native-community\clipboard\android\src\main\java\com\reactnativecommunity\clipboard\ClipboardModule.java
  2. import this : import com.facebook.react.bridge.ReactApplicationContext;
  3. convert extened package from ContextBaseJavaModule to ReactContextBaseJavaModule everywhere in file(maybe used at two places)
  4. conver this :
    from:
    public ClipboardModule(Context context) {
    super(context);
    }
    private ClipboardManager getClipboardService() {
    return (ClipboardManager) getcontext().getSystemService(getcontext().CLIPBOARD_SERVICE);
    }
    to:
    public ClipboardModule(Context context) {
    super(new ReactApplicationContext(context));
    }

private ClipboardManager getClipboardService() {
return (ClipboardManager) getReactApplicationContext().getSystemService(getReactApplicationContext().CLIPBOARD_SERVICE);
}

this worked for me . Hope this will guide you
thanks

from clipboard.

ManojJyaniMudulesSeventeen avatar ManojJyaniMudulesSeventeen commented on May 23, 2024 3

you need to just remove this package and @react-native-community\clipboard and install this reinstall this react-native-clipboard/clipboard one

from clipboard.

brien-crean avatar brien-crean commented on May 23, 2024 2

I also encountered this issue and after some investigation it was caused as I was forcing dependencies to run on Android API version 29 as I needed it at the time for StethoWrapper to work with my react native project for Chrome debugging. API version 29 does not have the enum WEBP_LOSSLESS in the graphics package ( I believe it was introduced in API 30) hence this error.

I use Flipper now so I just removed these lines from my android/build.gradle and removed StethoWrapper

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 29     // have to match with build.gradle and app/build.gradle ones
                buildToolsVersion '29.0.3'  // have to match with build.gradle and app/build.gradle ones
            }
        }
    }
}

from clipboard.

darriuk avatar darriuk commented on May 23, 2024 2

+1 Have same issue. It was introduced in v1.11.0 with support for WEBP. Version 1.10.0 works fine.

from clipboard.

MalcolmTomisin avatar MalcolmTomisin commented on May 23, 2024 2

Apologies to all who encountered this issue, please upgrade your compileSdkVersion to 30. The previous Bitmap.CompressFormat WEBP enum was deprecated in API level 30 hence WEBP_LOSSLESS enum was introduced. I'll make a PR to update this requirement in the docs.

from clipboard.

maurosoppelsa avatar maurosoppelsa commented on May 23, 2024 2

you need to just remove this package and @react-native-community\clipboard and install this reinstall this react-native-clipboard/clipboard one

this worked for me.

from clipboard.

RishiSetpal777 avatar RishiSetpal777 commented on May 23, 2024 1

you need to just remove this package and @react-native-community\clipboard and install this reinstall this react-native-clipboard/clipboard one

actually i'm using react-native-otp-model by using @twotalltotems/react-native-otp-input library. but i'm getting this error.Cannot read property 'getString' of null. have you resolved this error earlier?

+1 Same

I have tried uninstalling and Re-installing
Try 1:
npm install @twotalltotems/react-native-otp-input
react-native-clipboard/clipboard
Try 2:
npm install --save @react-native-community/react-native-clipboard
Try 3:
Tried togeling minSdkVersion from 21 to 24 and vise versa.

i have also raised the same
tttstudios/react-native-otp-input#227

from clipboard.

Nziranziza avatar Nziranziza commented on May 23, 2024

I am having similar issue

from clipboard.

w1ndyz avatar w1ndyz commented on May 23, 2024

+1, i meet the same issue.

from clipboard.

coderdave avatar coderdave commented on May 23, 2024

What about for compileSdkVersion: 31 and targetSdkVersion = 31?

from clipboard.

MalcolmTomisin avatar MalcolmTomisin commented on May 23, 2024

@coderdave you should have no issues on that API level

from clipboard.

coderdave avatar coderdave commented on May 23, 2024

I get this note when on version 31:
.../node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java uses or overrides a deprecated API.

It's not an error. I have something else that is causing my build to fail I think.

from clipboard.

MalcolmTomisin avatar MalcolmTomisin commented on May 23, 2024

You might want to check for the error message if your build is failing

from clipboard.

Anubhavjain786 avatar Anubhavjain786 commented on May 23, 2024

Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
> Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
**> Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac **FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED
Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED


from clipboard.

ManojJyaniMudulesSeventeen avatar ManojJyaniMudulesSeventeen commented on May 23, 2024

what about this

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-community_clipboard:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:

Run with --info option to get more log output.
Run with --scan to get full insights.

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.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 38s
183 actionable tasks: 169 executed, 14 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

error Failed to build the app.
Error: Command failed with exit code 1: ./gradlew app:bundleRelease
at makeError (/home/manojjyani/Public/BUY/node_modules/execa/lib/error.js:60:11)
at module.exports.sync (/home/manojjyani/Public/BUY/node_modules/execa/index.js:194:17)
at build (/home/manojjyani/Public/BUY/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/buildAndroid/index.js:68:22)
at Object.buildAndroid [as func] (/home/manojjyani/Public/BUY/node_modules/react-native/node_modules/@react-native-community/cli-platform-android/build/commands/buildAndroid/index.js:60:10)
at Command.handleAction (/home/manojjyani/Public/BUY/node_modules/@react-native-community/cli/build/index.js:118:23)
at Command.listener [as _actionHandler] (/home/manojjyani/Public/BUY/node_modules/commander/lib/command.js:482:17)
at /home/manojjyani/Public/BUY/node_modules/commander/lib/command.js:1283:65
at Command._chainOrCall (/home/manojjyani/Public/BUY/node_modules/commander/lib/command.js:1177:12)
at Command._parseCommand (/home/manojjyani/Public/BUY/node_modules/commander/lib/command.js:1283:27)
at /home/manojjyani/Public/BUY/node_modules/commander/lib/command.js:1081:27

from clipboard.

Princejain21 avatar Princejain21 commented on May 23, 2024

you need to just remove this package and @react-native-community\clipboard and install this reinstall this react-native-clipboard/clipboard one

actually i'm using react-native-otp-model by using @twotalltotems/react-native-otp-input library. but i'm getting this error.Cannot read property 'getString' of null. have you resolved this error earlier?

from clipboard.

manishprimathon avatar manishprimathon commented on May 23, 2024

I have also same issue like below

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-community_clipboard:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

I have already set minSdkVersion to 24

from clipboard.

xdrcft8000 avatar xdrcft8000 commented on May 23, 2024

I followed below steps which solved my problem.

  1. go to this file.
    node_modules@react-native-community\clipboard\android\src\main\java\com\reactnativecommunity\clipboard\ClipboardModule.java
  2. import this : import com.facebook.react.bridge.ReactApplicationContext;
  3. convert extened package from ContextBaseJavaModule to ReactContextBaseJavaModule everywhere in file(maybe used at two places)
  4. conver this :
    from:
    public ClipboardModule(Context context) {
    super(context);
    }
    private ClipboardManager getClipboardService() {
    return (ClipboardManager) getcontext().getSystemService(getcontext().CLIPBOARD_SERVICE);
    }
    to:
    public ClipboardModule(Context context) {
    super(new ReactApplicationContext(context));
    }

private ClipboardManager getClipboardService() { return (ClipboardManager) getReactApplicationContext().getSystemService(getReactApplicationContext().CLIPBOARD_SERVICE); }

this worked for me . Hope this will guide you thanks

worked for me, thank you!

from clipboard.

sunny812546 avatar sunny812546 commented on May 23, 2024

return (ClipboardManager) getReactApplicationContext().getSystemService(getReactApplicationContext().CLIPBOARD_SERVICE);

Hey.!

#155 (comment) working fine for me.!

from clipboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.