Skip to content
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

Update ClipboardModule.java #251

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

alexanderblackh
Copy link
Contributor

Change removeListener arg from int to double due to NewArch changes

Overview

New Arch in 0.73 causes some issues due to type checking. Simply changed from Int to Double since the error mention it as well as the recommendation from #238

.../node_modules/@react-native-clipboard/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:39: error: ClipboardModule is not abstract and does not override abstract method removeListeners(double) in NativeClipboardModuleSpec
public class ClipboardModule extends NativeClipboardModuleSpec {
       ^
.../node_modules/@react-native-clipboard/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java:240: error: method does not override or implement a method from a supertype
  @Override
  ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: .../node_modules/@react-native-clipboard/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardPackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

Test Plan

Did not do any testing other then standard app usage. Before this change, I couldn't build. Now I can and everything works as anticipated

Change removeListener arg from int to double due to NewArch changes
@sync
Copy link

sync commented Jul 10, 2024

this will break if not using the new architecture

@huutritran
Copy link

FYI, react-native-codegen is treat any number as ** double** right now when building turbo module.
So this is a must have fix; but please make sure you update this spec as well in case people not using new architecture - it should not be broken @alexanderblackh @sync

Copy link

@XFAISAL XFAISAL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on New Arch

Copy link
Member

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm
Will fix the type in specs file in another pr

@Naturalclar Naturalclar merged commit 22743a8 into react-native-clipboard:master Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants