Skip to content
This repository has been archived by the owner on Mar 16, 2019. It is now read-only.

rnpm link fails if android folder has non-standard structure #116

Closed
xxsnakerxx opened this issue Aug 31, 2016 · 6 comments
Closed

rnpm link fails if android folder has non-standard structure #116

xxsnakerxx opened this issue Aug 31, 2016 · 6 comments

Comments

@xxsnakerxx
Copy link

Hi!

My android folder has following structure
/android/app/src/main/java/com/{companyName}/{appName}/MainApplication.java

In this case rnpm link fails with error that described here

It would be better just use console.log('Warning, ...') instead of thrown

@wkh237
Copy link
Owner

wkh237 commented Aug 31, 2016

@xxsnakerxx , thanks for the advice !! I'll add a more detailed error message to the link script !!

@Nopik
Copy link

Nopik commented Sep 6, 2016

Just got bitten by this, too. Actually, the proper solution would be to remove whole prelink script and mention in readme what permissions need to be added. Some apps might have the permissions already, so having the modifications listed twice there wont be good.
Writing to manifest like prelink.js does isn't really a good practice.

For me it was enough reason to find alternative component, or at least fork this one for the sole purpose of removing prelink.js completely.

@wkh237
Copy link
Owner

wkh237 commented Sep 6, 2016

@Nopik , thanks for the advice. I think the prelink script is still necessary for some reason.

For developers who do not, or don't have the knowledge changing native code, the script makes the installation easier. On the other hand, React Native is changing in very fast pace, sometimes the library just broken after a new release, one purpose of the script is to make the library working properly on different version.

I'm agree with you that implicitly changing permission is not a good idea. What if adding an option to prelink script which makes it only execute default rnpm link ?

For example

$ RNFB_PRELINK=false rnpm link

Of course, there will be a more detailed instruction about manually linking the library.

How do you think ?

@Nopik
Copy link

Nopik commented Sep 6, 2016

Well, for me it would mean that we always will need to run RNFB_PRELINK=false react-native link, and teach everybody in the team to do so. That can be done, and at least things will be working, it just will be a giant PITA. The fact is that the prelink.js is not working for us, and out of ~20 packages yours is the only one, and we'll have to remember about it forever, otherwise link wont work. So, technically, it is workable solution, but definitely not a convenient one.

One of the better methods would be to detect the missing changes and either notify user about those (e.g. Modifications are turned off by default, please rerun this script with RNFB_PRELINK=true to upgrade your project) or prompt right away (just like react-native upgrade does) - if only it wont need to be done each and every time upon linking some new packages.

@wkh237
Copy link
Owner

wkh237 commented Sep 6, 2016

@Nopik , it sounds pretty make sense 👍 I'll change the way it works, thank you for your great suggestion 😄

@wkh237
Copy link
Owner

wkh237 commented Sep 8, 2016

The change has launched in 0.9.4 so I'm going to close this issue. Please feel free reopen the issue if there's any problem, thank you 😄

@wkh237 wkh237 closed this as completed Sep 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants