React-native-vector-icons: cannot find symbol new VectorIconsPackage()

Created on 8 Jul 2016  路  21Comments  路  Source: oblador/react-native-vector-icons

Hey guys i am trying to use react-native-vector-icons in my project but facing problem while building my project
error2
here is my code for MainActivity.java
protected List getPackages() {
return Arrays.asList(
new MainReactPackage(),
new VectorIconsPackage(),
new MapsPackage(this)
);

please help guys.Thanks in advance

Most helpful comment

FYI, if you use react-native link to install and it fails with this error, its because its missing the
compile project(':react-native-vector-icons') under dependencies at android/app/build.gradle

also to make sure you don't re-link other packages you can do react-native link react-native-vector-icons for specific linking

All 21 comments

Same issue here, had to manually remove it

Can you tell me how you removed it manually?

With removing I meant not using these icons, I tried to remove it using rnpm unlink and uninstall but it didnt help, so I had to go to MainActivity.java and remove it myself.

Try integrating manually with the step-by-step instructions if rnpm fails.

@oblador Followed the manual instruction, still no good
@mateoKaradza doesn't removing it disables the usage of this repo?

Why is this issue closed?
Is there any fix to this?
I'm still getting this error even after manual step-by-step insturctions

Same

@Boredude: To use the basic functionality you only need the fonts themselves. It works just fine for a great deal of projects including the example project, the only ones i know of having trouble are using rnpn. It's very likely you overlooked a manual step or have a bad java/android setup. If you are certain it's a bug with this project and not yours, please post a link to a repo with minimal code reproducing this bug and I'll look into it.

@oblador I intentionally skiped couple of steps in the manual installation due to this message

These steps are optional and only needed if you want to use the Icon.getImageSource function or using custom icons in the Icon.ToolbarAndroid component.

Apparently those steps were critical and once I did them I got this working.

Thanks

Apparently those steps were critical and once I did them I got this working.

@oblador maybe its worth updating the readme

@aviadhahami That by ignoring installation steps you cannot expect it to work? :-)

@oblador The readme states that these steps are optional. However they were mendatory. I think this is what @aviadhahami meant was worth updating

They _are_ optional for most use cases and the docs state when they are mandatory:

These steps are optional and only needed if you want to use the Icon.getImageSource function or using custom icons in the Icon.ToolbarAndroid component.

FYI, if you use react-native link to install and it fails with this error, its because its missing the
compile project(':react-native-vector-icons') under dependencies at android/app/build.gradle

also to make sure you don't re-link other packages you can do react-native link react-native-vector-icons for specific linking

I used react-native link, but it did not work on android - iOS was fine.

I realized that this line
import com.oblador.vectoricons.VectorIconsPackage;
was missing in MainApplication.java

Hope I could help!

this kind of errors happen usually when there is missing dependency or import . check for those issues . in build.gradle or main java file .

@fmoessle Putting 'import com.oblador.vectoricons.VectorIconsPackage;' in MainApplication.java helped. Thanks.

Add this import on MainApplication.java
import com.oblador.vectoricons.VectorIconsPackage;

this solved my problem. Hope it helps

Add this import on MainApplication.java
import com.oblador.vectoricons.VectorIconsPackage;

this solved my problem. Hope it helps

no, it's not helping, still have the same issue

@Kopatch worked here, thanks!

@fmoessle solved my issue
Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

obykoo picture obykoo  路  3Comments

afilp picture afilp  路  4Comments

toddmetheny picture toddmetheny  路  4Comments

arjs1000 picture arjs1000  路  3Comments

tharrington picture tharrington  路  4Comments