Comments (19)
I followed below steps which solved my problem.
- go to this file.
node_modules@react-native-community\clipboard\android\src\main\java\com\reactnativecommunity\clipboard\ClipboardModule.java - import this : import com.facebook.react.bridge.ReactApplicationContext;
- convert extened package from ContextBaseJavaModule to ReactContextBaseJavaModule everywhere in file(maybe used at two places)
- 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.
you need to just remove this package and @react-native-community\clipboard and install this reinstall this react-native-clipboard/clipboard one
from clipboard.
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.
+1 Have same issue. It was introduced in v1.11.0 with support for WEBP. Version 1.10.0 works fine.
from clipboard.
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.
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.
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.
I am having similar issue
from clipboard.
+1, i meet the same issue.
from clipboard.
What about for compileSdkVersion: 31
and targetSdkVersion = 31
?
from clipboard.
@coderdave you should have no issues on that API level
from clipboard.
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.
You might want to check for the error message if your build is failing
from clipboard.
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.
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.
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.
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.
I followed below steps which solved my problem.
- go to this file.
node_modules@react-native-community\clipboard\android\src\main\java\com\reactnativecommunity\clipboard\ClipboardModule.java- import this : import com.facebook.react.bridge.ReactApplicationContext;
- convert extened package from ContextBaseJavaModule to ReactContextBaseJavaModule everywhere in file(maybe used at two places)
- 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.
return (ClipboardManager) getReactApplicationContext().getSystemService(getReactApplicationContext().CLIPBOARD_SERVICE);
Hey.!
#155 (comment) working fine for me.!
from clipboard.
Related Issues (20)
- Copy Gif To Clipboard HOT 1
- andriod build failed
- Hide Eclipse
- Cannot use the attributes of Clipboard in windows
- Unable to empty clipboard :) HOT 1
- Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. HOT 7
- [Android-New Arch] Cannot specify link libraries for target "react_codegen_RNCClipboard" which is not built by this project HOT 15
- Can we deprecate the NPM package for @react-native-community/clipboard
- no idea why need to link
- How get to work with Expo HOT 1
- App Hanging: App hanging for at least 2000 ms. Happens for iOS devices only. HOT 3
- Clear the clipboard
- Android: After upgrading to React Native version 0.73, build failed HOT 7
- Monorepo REACT_NATIVE_NODE_MODULES_DIR error HOT 2
- Getting "copied" send to device in android 13 HOT 1
- Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED HOT 14
- SetString("") not clear Gboard's clipboard
- Expose access to EXTRA_IS_SENSITIVE for setString on Android
- Error to Deploy to Android RN 0.73.2 HOT 6
- ios listener not being called
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clipboard.