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

Auto link issue #25506

Closed
lehang123 opened this issue Jul 5, 2019 · 6 comments
Closed

Auto link issue #25506

lehang123 opened this issue Jul 5, 2019 · 6 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@lehang123
Copy link

lehang123 commented Jul 5, 2019

When I follow the instruction by the react-navigation website : https://reactnavigation.org/docs/en/getting-started.html.

react-native link react-native-gesture-handler

and then change the MainActivity.java like it asks.

Then run react-native run-android, and error pop up :
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:

react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink " and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.

React Native version:
info Fetching system and libraries information...
System:
OS: macOS 10.14.5
CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz
Memory: 6.32 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.5.0 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 21, 22, 23, 24, 25, 26, 27, 28
Build Tools: 21.1.2, 22.0.1, 23.0.2, 23.0.3, 24.0.0, 24.0.1, 24.0.2, 25.0.0, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 27.0.0, 27.0.2, 27.0.3, 28.0.3
System Images: android-23 | Google APIs ARM EABI v7a, android-28 | Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
Android NDK: 15.2.4203891
IDEs:
Android Studio: 3.0 AI-171.4443003
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: ^0.60.0 => 0.60.0
npmGlobalPackages:
react-native-cli: 2.0.1

However, when I follow the instruction, to unlink the library
use : react-native unlink react-native-gesture-handler

The app successfully built, but now it pops up another error in the app :
null is not an object (evaluating 'rngesturehandlermodule.direction')
I tried a lot of solution in a lot of websites, like
#494
https://stackoverflow.com/questions/52861437/undefined-is-not-an-object-evaluating-rngesturehandlermodule-state

non of them is working for me

@lehang123 lehang123 added the Bug label Jul 5, 2019
@superoo7
Copy link

superoo7 commented Jul 5, 2019

Read this https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked

You don't need to run react-native link anymore in most scenario.

@lehang123
Copy link
Author

I un-linked it, but then another error pop up :

Screenshot 2019-07-05 at 12 04 41 PM

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the React Native version: section?

If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.

@thymikee
Copy link
Contributor

thymikee commented Jul 5, 2019

React Native Gesture Handler is not compatible with autolinking yet. Please send this issue over there to them. The error says explicitly:

If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.

So please do so, here's the link to the repo: https://github.com/kmagiera/react-native-gesture-handler

@thymikee thymikee closed this as completed Jul 5, 2019
@smooJitter
Copy link

So if it isn't compatible does that mean it can't be used?

@thymikee
Copy link
Contributor

@smooJitter it is compatible and can be used with newest RN. If linked manually, it needs to be unlinked with yarn react-native unlink react-native-gesture-handler. If it's not linked yet, install it and follow https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html#android on Android (this is the only change that needs to be done manually for this package), then run cd ios && pod install to make it work on iOS.

Also make sure to update the @react-native-community/cli to the latest version.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 5, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants