osamaqarem/react-native-image-colors

Evaluating 'ImageColorsModule.getColors' error

CharliBregnballe opened this issue · 15 comments

Hi,
I am getting the following error when trying to fetch colors from an image:
`[Unhandled promise rejection: TypeError: null is not an object (evaluating 'ImageColorsModule.getColors')]

  • node_modules/react-native-image-colors/index.js:7:26 in ImageColors.getColors`

The object (or the url of the image) is not null.

Looks like an awesome library and I really hope I can make it work :)

Thanks!
If you could post your code, that'd help me troubleshoot it.

I actually just used the code from your example.
But I am running Expo, which might cause the error?

Sorry, this library is using native code therefore it's not compatible with expo managed projects. You have to eject to install it.

Edit: this library can now be compatible with expo managed projects using the prebuild command. See latest docs.

Alrighty! Thank you for your answer :)

Sorry, this library is using native code therefore it's not compatible with expo managed projects. You have to eject to install it.

Then why did you said that the example of this project has been made in expo ?? You said it is working in expo in description. But you are now saying it won't work in expo project. Please update your repo desc otherwise people will get confuse and lose hours with finding solution like I'm.

Thank you

Sorry, this library is using native code therefore it's not compatible with expo managed projects. You have to eject to install it.

Then why did you said that the example of this project has been made in expo ?? You said it is working in expo in description. But you are now saying it won't work in expo project. Please update your repo desc otherwise people will get confuse and lose hours with finding solution like I'm.

Thank you

Sorry, what do you mean by "now"? My comment you're quoting is from 2 years ago. The library does support expo today and the docs are correct to say so. In fact the example app in the repo is an expo app.

Sorry, this library is using native code therefore it's not compatible with expo managed projects. You have to eject to install it.

Then why did you said that the example of this project has been made in expo ?? You said it is working in expo in description. But you are now saying it won't work in expo project. Please update your repo desc otherwise people will get confuse and lose hours with finding solution like I'm.
Thank you

Sorry, what do you mean by "now"? My comment you're quoting is from 2 years ago. The library does support expo today and the docs are correct to say so. In fact the example app in the repo is an expo app.

Yeah, I mean now like now, right now. And it is not working. :) Hope I'm wrong but still taking same error as said in the issue.

Sorry, this library is using native code therefore it's not compatible with expo managed projects. You have to eject to install it.

Then why did you said that the example of this project has been made in expo ?? You said it is working in expo in description. But you are now saying it won't work in expo project. Please update your repo desc otherwise people will get confuse and lose hours with finding solution like I'm.

Thank you

Sorry, what do you mean by "now"? My comment you're quoting is from 2 years ago. The library does support expo today and the docs are correct to say so. In fact the example app in the repo is an expo app.

Yeah, I mean now like now, right now. And it is not working. :) Hope I'm wrong but still taking same error as said in the issue.

If you followed the steps in the README and still could not get it to work, feel free to submit a new issue about it. A repo with a minimum reproducible example would be the fastest way to understand the problem you're facing.

Sorry, this library is using native code therefore it's not compatible with expo managed projects. You have to eject to install it.

Then why did you said that the example of this project has been made in expo ?? You said it is working in expo in description. But you are now saying it won't work in expo project. Please update your repo desc otherwise people will get confuse and lose hours with finding solution like I'm.

Thank you

Sorry, what do you mean by "now"? My comment you're quoting is from 2 years ago. The library does support expo today and the docs are correct to say so. In fact the example app in the repo is an expo app.

Yeah, I mean now like now, right now. And it is not working. :) Hope I'm wrong but still taking same error as said in the issue.

If you followed the steps in the README and still could not get it to work, feel free to submit a new issue about it. A repo with a minimum reproducible example would be the fastest way to understand the problem you're facing.

Okey, I will try more. If not work, will open the issue. Thanks.

Hello,

Thank you for this wonderful library.

In order to make it compatible with Expo, could you please confirm that this sequence of steps is in the right order ?

  • npx create-expo-app ExpoProject

  • cd ExpoProject

  • expo prebuild

  • npm install react-native-image-colors

  • npm start

Thank you

hey @aymeric75 - I can see a mistake in your steps. the correct steps are:

npx create-expo-app ExpoProject;

cd ExpoProject;

npm install react-native-image-colors;

expo prebuild;

# to build for iOS or Android (first time after installing a library with native code only)
expo run:ios
expo run:android

unless you already did, make sure to check the README in the future. if u still need help after that - it would be nice to create a new question in discussions or a new issue if you think its a problem in the library. this is cool since we avoid bothering the author of this github issue 🌈

I have done all the steps still this issue of null object with an Expo managed app...

I just tested the above steps and it is working on my end.
At this point the quickest way I can help is if you can take the time to create a new github issue along with a repository created with create-expo-app where I can reproduce the error you are seeing.

Hello @osamaqarem thanks for you help, I am going to do this.

Just ran through the install steps listed for expo and can also confirm it's working for me.