Open caifel opened 4 years ago
Sorry for not adding extra details, but it is as simple as that
I also could not make it run on Android 10 (32-bit emulator with Expo v38.0.8). There is an orange box saying null is not an object (evaluating NativeClipboard_1.default.setString)
I found a demo but it is not supported for Android 10 too (expo SDK newer than v32 when I tried to use it on Android 120 physical device). https://snack.expo.io/@aboutreact/clipboard-example?session_id=snack-session-45GVESXWi
I also had the same issue and it breaks my production app. What's weird is it works fine on one Android9 phone (Redmi Note7) and not the other running Android9 (Galaxt Note 8). Android10 straight out gives similar error. Using RN0.60.4. If anyone can advise it would be cool. Thanks
I also had the same issue and it breaks my production app. What's weird is it works fine on one Android9 phone (Redmi Note7) and not the other running Android9 (Galaxt Note 8). Android10 straight out gives similar error. Using RN0.60.4. If anyone can advise it would be cool. Thanks
Nvm. Found the issue, I've been using react-native-code-push package and just added the clipboard library today. Forgot that the codepush only involves js files so it's library linking/binary issue. For others, try to check linking first or make sure the clipboard library is in node_modules
Same issue here...
same Issue here but i face that 👍 object (evaluating NativeClipboard_1.default.getString)
Related to #53, use the deprecated Clipboard
instead if you're using Expo
.
I solve it after I Add Clipboard from React Native Comunity
I am not using expo and I am running into this issue.
I was able to fix this by manually adding the Clipboard package to MainApplication.java. For whatever reason, the link command did not add it. I'm on 0.59.10.
import com.reactnativecommunity.clipboard.ClipboardPackage; // <- Add this line
// other import commands
public class MainApplication extends Application implements ReactApplication {
// other code
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
// Other packages...
new ClipboardPackage() // <- Add this line
);
}
// ....More code
I have the same problem, but it can be solved by uninstalling the app and re installing it
android 8.0.0 RN 0.63.1 @react-native-community/clipboard 1.2.3
Additionally to @cmcaboy You might need to include
implementation project(':@react-native-clipboard_clipboard')
in android/app/build.gradle
within dependencies {
and
include ':@react-native-clipboard_clipboard'
project(':@react-native-clipboard_clipboard').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-clipboard/clipboard/android')
in android/settings.gradle
The same issue
Environment
Platforms
Android
Versions
Description
Instead of the clipboard object
null
is returned.Reproducible Demo
https://snack.expo.io/@aboutreact/clipboard-example?session_id=snack-session-45GVESXWi