React-native-interactable: Android linking gone

Created on 2 Aug 2017  路  10Comments  路  Source: wix/react-native-interactable

The command react-native link react-native-interactable only links iOS :

rm -fr node_modules
yarn add react-native-interactable
react-native link react-native-interactable

with version 0.1.1

Most helpful comment

How I solved the react native linking issue. Ensure the following:

In MainApplication.java
import com.wix.interactable.Interactable;
&&
@Override
protected List getPackages() {
return Arrays.asList(
new Interactable(),
...

build.gradle (linking on Android doesn't add this by default). Add the dependency:
dependencies {
compile project(path: ':react-native-interactable') ...

setting.gradle (in top level android folder) (the default path when using link isn't correct - need to change it to lib/android)
include ':react-native-interactable'
project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android')

All 10 comments

I feel like I have the exact same problem, running on iOS works fine, but Android doesn't work

@Kernael in my case Interactable() wasn't added on getPackages(). Adding that fixed it for me

@lucasstorti @Kernael The issue was the same for me. I'll add the import so ppl don't have to go look: import com.wix.interactable.Interactable;

doesn't seem to link yet. can someone all the instructions for linking in Android please?

How I solved the react native linking issue. Ensure the following:

In MainApplication.java
import com.wix.interactable.Interactable;
&&
@Override
protected List getPackages() {
return Arrays.asList(
new Interactable(),
...

build.gradle (linking on Android doesn't add this by default). Add the dependency:
dependencies {
compile project(path: ':react-native-interactable') ...

setting.gradle (in top level android folder) (the default path when using link isn't correct - need to change it to lib/android)
include ':react-native-interactable'
project(':react-native-interactable').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-interactable/lib/android')

Glad I stumbled upon this (after an hour of scratching my head)! Thanks!

Thank you @jamesdyer8

I am closing the issue as a part of an effort to cleanup and revive the project. If this issue persists after v1.0.0, you are more than welcome to reintroduce it.

Thanks for your contribution.

_This issue is still existend with RN 0.62.2. Also, since the Package List is Auto-Generated we can not add it there in a convenient way anymore. Any suggestions?_

Edit: The Source is located under "lib/android", therefore react won't link it.
Moving it to the root of the package fixes this issue.

Hello, it seems like the library still has issues with linking with Android. Any solutions?

Was this page helpful?
0 / 5 - 0 ratings