Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

Error: Import libraries to android "rnpm link" #37

Open
hieudole opened this issue Jul 18, 2016 · 15 comments
Open

Error: Import libraries to android "rnpm link" #37

hieudole opened this issue Jul 18, 2016 · 15 comments

Comments

@hieudole
Copy link

The line of code import com.psykar.cookiemanager.CookieManagerPackage; should be placed in the MainApplication.java file instead of MainActivity.java

@dphov
Copy link

dphov commented Jul 19, 2016

I have same error

@ackdav
Copy link

ackdav commented Jul 19, 2016

+1

@afilp
Copy link

afilp commented Jul 20, 2016

+1 same error, I hope it can be fixed so that we can continue development. Thanks!

@hieudole
Copy link
Author

You can apply the quick fix below:

  1. Delete the line of code import com.psykar.cookiemanager.CookieManagerPackage; in MainActivity.java
  2. Add import com.psykar.cookiemanager.CookieManagerPackage; to MainApplication.java
  3. Add following code to MainApplication.java:
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new CookieManagerPackage() // Add this code
      );
    }

Hope this help!

@Kureev
Copy link

Kureev commented Jul 25, 2016

Or just use react-native link, we fixed it there

@Lothav
Copy link

Lothav commented Jul 25, 2016

getting same error.
Not solve for me =/
My dep versions:
"react": "15.2.1", "react-native": "0.30.0", "react-native-cookies": "1.0.2",

@gelobelo02
Copy link

gelobelo02 commented Jul 26, 2016

Same for me getting errors still

@Kureev
Copy link

Kureev commented Jul 26, 2016

Strange, MainApplication thingy has been fixed in 0.29-rc2: facebook/react-native@3c8a2ee

@Lothav
Copy link

Lothav commented Jul 26, 2016

Srry, mb. I just
react-native upgrade
and works fine

@cbcye
Copy link

cbcye commented Jul 31, 2016

I use following steps to fix this problem:

  1. modify MainApplication.java as hieudole sad above.
  2. npm upgrade -g rnpm
  3. rnpm link react-native-cookies

then use react-native run-android, it is working.

@Kureev
Copy link

Kureev commented Jul 31, 2016

I'd recommend to use react-native link instead of rnpm. We're about to deprecate rnpm as soon as it's merged into react-native core. We announce it when the first react-native release with rnpm on board will come into the world.

@adrianotadao
Copy link

Guys, How can I remove the rnpm's things here? Is it possible now?

Here solved the problem like @hieudole told us but, I'm not quite happy with that. It seems that before long it will crash again

@Kureev
Copy link

Kureev commented Oct 28, 2016

react-native unlink <name-of-library> should do the trick

@kssujithcj
Copy link

@hieudole, How do we do this in Expo app, since my android packages not present in project directory?

@Kureev
Copy link

Kureev commented Mar 16, 2017

@kssujithcj AFAIK Expo app doesn't support custom native modules

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants