-
Notifications
You must be signed in to change notification settings - Fork 237
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
i'm 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? #227
Comments
@RishiSetpal777 is this issue got fixed ? |
After checking, I think this happens because of the use of Clipboard from The error derives from Clipboard.getString().then(code => {
...
} An easy but temporary way is to use patch-package to disable the function call:
Notice: You should only need |
I had the same issue, tried downgrading package helped! |
i had the same issue, what i did to fix it,
After installing this you will likely get an error, your new code should be looking like public static final String NAME = "RNCClipboard"; @OverRide private ClipboardManager getClipboardService() { |
Describe the bug
i'm using @twotalltotems/react-native-otp-input library. but I'm getting this error. Cannot read property 'getString' of null.
Detailed Error
Details
info A dev server is already running for this project on port 8081.
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.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
111 actionable tasks: 5 executed, 106 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
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:14: error: cannot find symbol
import com.facebook.react.bridge.ContextBaseJavaModule;
^
symbol: class ContextBaseJavaModule
location: package com.facebook.react.bridge
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:23: error: cannot find symbol
public class ClipboardModule extends ContextBaseJavaModule {
^
symbol: class ContextBaseJavaModule
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardPackage.java:23: error: incompatible types: ClipboardModule cannot be converted to NativeModule
modules.add(new ClipboardModule(reactContext));
^
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:31: error: method does not override or implement a method from a supertype
@OverRide
^
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:37: error: cannot find symbol
return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE);
^
symbol: method getContext()
location: class ClipboardModule
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:37: error: cannot find symbol
return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE);
^
symbol: method getContext()
location: class ClipboardModule
Note: /Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
6 errors
FAILURE: Build failed with an exception.
Execution failed for task ':react-native-community_clipboard:compileDebugJavaWithJavac'.
BUILD FAILED in 7s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:14: error: cannot find symbol
import com.facebook.react.bridge.ContextBaseJavaModule; ^ symbol: class ContextBaseJavaModule location: package com.facebook.react.bridge
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:23: error: cannot find symbol
public class ClipboardModule extends ContextBaseJavaModule { ^ symbol: class ContextBaseJavaModule
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardPackage.java:23: error: incompatible types: ClipboardModule cannot be converted to NativeModule modules.add(new ClipboardModule(reactContext)); ^
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:31: error: method does not override or implement a method from a supertype @OverRide ^
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:37: error: cannot find symbol return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE); ^ symbol: method getContext() location: class ClipboardModule
/Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:37: error: cannot find symbol return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE); ^ symbol: method getContext() location: class ClipboardModule
Note: /Users/admin/projectname/projectname/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
6 errors FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':react-native-community_clipboard:compileDebugJavaWithJavac'.
To Reproduce
Steps to reproduce the behaviour:
Smartphone (please complete the following information):
Additional context
Packages that are already installed
The text was updated successfully, but these errors were encountered: