React-native-interactable: Invariant Violation: requireNativeComponent: "InteractableView" was not found in the UIManager. In "react-native": "0.60.4" only in Android

Created on 8 Aug 2019  路  13Comments  路  Source: wix/react-native-interactable

Most helpful comment

With RN 0.60.5, follow the manual link as below:

  1. android/app/build.gradle > dependencies

implementation "com.facebook.react:react-native:+" // From node_modules
// https://github.com/wix/react-native-interactable
implementation project(path: ":react-native-interactable") <-- Add this line

  1. android/settings.gradle
    rootProject.name = 'yourappname'
    apply from: file("../node_modules/@react-native-community/cli-platform-> android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

include ':react-native-interactable' <-- Add this line
project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android') <-- Add this line

include ':app'

  1. android/app/src/main/java/.../MainApplication.java
    import com.wix.interactable.Interactable; <-- Add this line

// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new Interactable()); <-- Add this line

-- Done --
This is working for me in android, hope will help you!

All 13 comments

Autolinking is not working at the moment for android thus this error occurs. Related to #288

have this problem in iOS as well, tried manual via pods, and even added the podspec file, still no luck, can anyone help ?

have this problem in iOS as well, tried manual via pods, and even added the podspec file, still no luck, can anyone help ?
Please try these steps:

  1. yarn add https://github.com/wix/react-native-interactable.git#master
  2. Install pods by running cd ios and pod install.

This is working for me in ios, my react native version is 0.60.4.

have this problem in iOS as well, tried manual via pods, and even added the podspec file, still no luck, can anyone help ?
Please try these steps:

1. yarn add https://github.com/wix/react-native-interactable.git#master

2. Install pods by running cd ios and pod install.

This is working for me in ios, my react native version is 0.60.4.

This didn't work for me, after days and lack of sleep, finally found something. Make sure Interactable is installed by checking this things

  1. Interactable.podspec is in node_modules/react-native-interactable
  2. Interactable is in ios/Pods

if the above are there, do the following step 馃憤

Delete Interactable in the podfile, but do not run pod install, interactable will be available in the podfile.lock only

I dont know why but this is what works for me

ISSUES

Sometime interactable will still pop up an error saying uimanager is not found, if this happens just react-native unlink react-native-interactable, npm install directly from the git master, add the podspec and pod install, delete interactable reference in podfile (PROJECT/ios/podfile), clean your build folder from xccode, and run again

No luck for me using master with RN 0.60.5 =(

I am still facing the issue in react-native 0.60.5 for android

With RN 0.60.5, follow the manual link as below:

  1. android/app/build.gradle > dependencies

implementation "com.facebook.react:react-native:+" // From node_modules
// https://github.com/wix/react-native-interactable
implementation project(path: ":react-native-interactable") <-- Add this line

  1. android/settings.gradle
    rootProject.name = 'yourappname'
    apply from: file("../node_modules/@react-native-community/cli-platform-> android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)

include ':react-native-interactable' <-- Add this line
project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android') <-- Add this line

include ':app'

  1. android/app/src/main/java/.../MainApplication.java
    import com.wix.interactable.Interactable; <-- Add this line

// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new Interactable()); <-- Add this line

-- Done --
This is working for me in android, hope will help you!

For ios i try to copy code https://github.com/wix/react-native-interactable/blob/master/Interactable.podspec to node_modules/react-native-interactable/Interactable.podspec (create new files)

and add to pod file
pod 'Interactable', :path => '../node_modules/react-native-interactable'

hope will help you

With RN 0.60.5, follow the manual link as below:

  1. android/app/build.gradle > dependencies

implementation "com.facebook.react:react-native:+" // From node_modules
// https://github.com/wix/react-native-interactable
implementation project(path: ":react-native-interactable") <-- Add this line

  1. android/settings.gradle

rootProject.name = 'yourappname'
apply from: file("../node_modules/@react-native-community/cli-platform-> android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':react-native-interactable' <-- Add this line
project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android') <-- Add this line
include ':app'

  1. android/app/src/main/java/.../MainApplication.java

import com.wix.interactable.Interactable; <-- Add this line
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new Interactable()); <-- Add this line

-- Done --
This is working for me in android, hope will help you!

I tried it but got the same error and it does not help :(

React Native 0.61.5

The solution above worked but I had another error about the JUnit and had to comment out the
// testImplementation 'junit:junit:4.12' from the build.gradle of the react-native-interactable. I know its a bad practice to edit node_module files but at least for the sake of trying the library, this step can be taken.

RN 0.59.1

To make autolinking work on android, add a file react-native.config with the following contents inside the ./node_modules/react-native-interactable folder:

module.exports = {
dependency: {
platforms: {
android: {
sourceDir: './lib/android',
},
},
},
};

Then you can use patch-package to save this change in a patch.

There's already a pull request for this change but for some reason it has not been merged yet: https://github.com/wix/react-native-interactable/pull/288

With RN 0.60.5, follow the manual link as below:

  1. android/app/build.gradle > dependencies

implementation "com.facebook.react:react-native:+" // From node_modules
// https://github.com/wix/react-native-interactable
implementation project(path: ":react-native-interactable") <-- Add this line

  1. android/settings.gradle

rootProject.name = 'yourappname'
apply from: file("../node_modules/@react-native-community/cli-platform-> android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':react-native-interactable' <-- Add this line
project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android') <-- Add this line
include ':app'

  1. android/app/src/main/java/.../MainApplication.java

import com.wix.interactable.Interactable; <-- Add this line
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new Interactable()); <-- Add this line

-- Done --
This is working for me in android, hope will help you!

I don't think you need to do this.

To make autolinking work on android, add a file react-native.config with the following contents inside the ./node_modules/react-native-interactable folder:

module.exports = {
dependency: {
platforms: {
android: {
sourceDir: './lib/android',
},
},
},
};

Then you can use patch-package to save this change in a patch.

There's already a pull request for this change but for some reason it has not been merged yet: https://github.com/wix/react-native-interactable/pull/288

@loveaurell You have saved me :)

Was this page helpful?
0 / 5 - 0 ratings