react-native-vector-icons: Error: Unable to resolve module `@react-native-community/toolbar-android`
After upgrading to the new version 6.7.0, bundling fails at:
error: Error: Unable to resolve module `@react-native-community/toolbar-android` from `node_modules\react-native-vector-icons\lib\toolbar-android.js`: @react-native-community/toolbar-android could not be found within the project.
Installing the @react-native-community/toolbar-android package solves the error, but I’m not sure if that’s the wanted behaviour. It should be mentioned in README at least.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 56
- Comments: 58 (5 by maintainers)
Commits related to this issue
- Pin react-native-vector-icons to 6.6.0 This is a workaround for this (hopefully temporary) issue: https://github.com/oblador/react-native-vector-icons/issues/1193 — committed to samkaufman/App-iOS by samkaufman 4 years ago
- fix from https://github.com/oblador/react-native-vector-icons/issues/1193#issuecomment-653604335 — committed to dimaportenko/magento-react-native by dimaportenko 4 years ago
- Added @react-native-community/toolbar-android because of that https://github.com/oblador/react-native-vector-icons/issues/1193 — committed to BooksOnWall/BooksOnWall_APP by deleted user 4 years ago
For me: I remove the ‘^’ from : -“react-native-vector-icons”: “^6.6.0” -> “react-native-vector-icons”: “6.6.0” rm -rf node_modules npm install
You’re getting those errors because the toolbar module is still in metro’s cache.
To fix this, run:
Hey, try out 7.0.0 where
Icon.AndroidToolbarhas been removed.for me even after installing
yarn add @react-native-community/toolbar-androidit does not work@oblador I get the following error after upgrading to
7.0.0:@Johan-dutoit Why would a Vector-Icon Library import an Android Toolbar Widget?
Great question…
@brunodias28 Yes, that would be downgrading to the latest working version. This issue is specifically for a bug in 6.7.0
Just Import it direct from react native it solves my problem
node_modules\react-native-vector-icons\lib\toolbar-android.js
import { ToolbarAndroid } from 'react-native';This worked for me
@xxczaki @hudaprs try to --reset-cache your metro server
thank you.
Closing as fixed in https://github.com/oblador/react-native-vector-icons/releases/tag/v7.0.0
Downgrade to 6.6.0 solved my problem
@amerllica
You don’t need to install toolbar-android. The version 7.0.0 fixes the problem.
As mention above, you may need to clear some caches, but it is working fine on Android and iOS without the dependency
Same problem here after upgrading to
7.0.0I’ve solved this issue doing this:
rm -rf node_modules/“react-native-vector-icons”: “^7.0.0”
npm iyarn add @react-native-community/toolbar-androidRun like this npm start:
npm start -- --reset-cacheI managed to solve it, redid the method, upgraded to 7.0.0 and cleared the cache with:
npm start -- --reset-cacheThank you
if this problem still exist just please go to package.json file and remove ^ from react-native-vector-icons like
"react-native-vector-icons": "6.6.0"and then folow the above steps.The solution of @amerllica is good. Be carefull that another library do not use also
react-native-vector-icons. For me it wasnative-basethat used the version 6.7.0. You can force the version with this tips in thepackage.json:Amazing, get back to work again, Thanks!
For my case, the project was using @native-base and it brings the latest version of @native-base/react-native-vector-icons … and at the same time forced to install dependency @react-native-community/toolbar-android solution when using native-base:
add resolutions on package.json:
it’s working for me
it works, thank you
yarn add @react-native-community/toolbar-androidthis worked for me using react-native 0.61.0 and react-native-vector-iicons 7.0.0LOL Works for me!!! Thanks man
This is what worked for me…
and I was back up and running.
@amerllica as already mentioned multiple times, you need to clear your cache. see my comment above.
@LuigiMaestrelli, I installed version
7.0.0and the problem still existed. For now, the right solution is installingtoolbar-android.