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

Can not read property 'State' of undefined when import Swipeable #230

Closed
nguyenhose opened this issue Jun 28, 2018 · 4 comments
Closed

Can not read property 'State' of undefined when import Swipeable #230

nguyenhose opened this issue Jun 28, 2018 · 4 comments

Comments

@nguyenhose
Copy link

nguyenhose commented Jun 28, 2018

image

I got this error when import Swipeable following docs

import Swipeable from 'react-native-gesture-handler/Swipeable';

my version package : "^1.0.2"

======
After investigate, I found that NativeModules.RNGestureHandlerModule is undefined in GestureHandler.js
const RNGestureHandlerModule = NativeModules.RNGestureHandlerModule;

@lcr0815
Copy link

lcr0815 commented Jul 1, 2018

I'm getting the same error along with and error from the build procedure. I'm running on a windows 10 insiders edition and this is the message from the cmd screen:

`:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareS9aReactNativeGestureHandlerUnspecifiedLibrary
:app:prepareS9aReactNativeVectorIconsUnspecifiedLibrary FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:prepareS9aReactNativeVectorIconsUnspecifiedLibrary'.

Could not copy zip entry \s9a\node_modules\react-native-vector-icons\android\build\outputs\aar\react-native-vector-icons-release
.aar!jni/ to '\s9a\android\app\build\intermediates\exploded-aar\s9a\react-native-vector-icons\unspecified\jni'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 52.237 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
`

Any help will be greatly appreciated.

@johnhaup
Copy link

johnhaup commented Jul 4, 2018

In case you haven't tried, I fixed this issue by cleaning my simulator, restarting my bundler, and reinstalling the app with react-native run-ios. For install I used react-native link and did not edit any other native iOS files. Hope this helps.

@nguyenhose
Copy link
Author

@johnhaup I think the problem here is NativeModules (which come from react-native) now support PanResponse, not RNGestureHandlerModule

@menahishayan
Copy link

Open Xcode, and add ./node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj to the Libraries folder

Next, go over to Build Phases > Link Binaries with Libraries, add libRNGestureHandler.a

Rebuild your application.

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

No branches or pull requests

4 participants