Giter VIP home page Giter VIP logo

Comments (13)

cmcaboy avatar cmcaboy commented on May 27, 2024 8

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

from clipboard.

dkocich avatar dkocich commented on May 27, 2024 2

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

from clipboard.

cmcaboy avatar cmcaboy commented on May 27, 2024 2

I am not using expo and I am running into this issue.

from clipboard.

dustinyoste avatar dustinyoste commented on May 27, 2024 2

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

from clipboard.

caifel avatar caifel commented on May 27, 2024

Sorry for not adding extra details, but it is as simple as that

from clipboard.

firdaussoberi avatar firdaussoberi commented on May 27, 2024

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

from clipboard.

firdaussoberi avatar firdaussoberi commented on May 27, 2024

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

from clipboard.

guitorioadar avatar guitorioadar commented on May 27, 2024

Same issue here...

from clipboard.

IbrahimSalem0 avatar IbrahimSalem0 commented on May 27, 2024

same Issue here but i face that 👍 object (evaluating NativeClipboard_1.default.getString)

from clipboard.

alexttyip avatar alexttyip commented on May 27, 2024

Related to #53, use the deprecated Clipboard instead if you're using Expo.

from clipboard.

IbrahimSalem0 avatar IbrahimSalem0 commented on May 27, 2024

I solve it after I Add Clipboard from React Native Comunity

from clipboard.

wangqiking avatar wangqiking commented on May 27, 2024

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

from clipboard.

miladezzat avatar miladezzat commented on May 27, 2024

The same issue

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.