Expo React Native编译报错:@notifee/react-native无有效配置插件
解决Expo编译时@notifee/react-native的config plugin错误
以下是针对该错误的几种排查和解决方法:
指定兼容的notifee版本
Expo 49对应React Native 0.72.x,部分高版本@notifee/react-native可能存在配置插件兼容问题。尝试降级到经过验证的兼容版本,比如v7.6.0:npm install @notifee/react-native@7.6.0 # 或使用yarn yarn add @notifee/react-native@7.6.0手动配置Expo插件
在app.json或app.config.js的expo.plugins数组中手动添加@notifee的配置插件,确保配置路径正确:{ "expo": { "plugins": [ "@notifee/react-native" ] } }执行清理预构建命令后重新编译:
npx expo prebuild --clean重置预构建文件
若使用bare workflow或已执行过prebuild,备份android和ios目录后删除,重新生成预构建文件:npx expo prebuild清理依赖缓存
清除依赖缓存并重新安装所有依赖:# npm npm cache clean --force rm -rf node_modules package-lock.json npm install # yarn yarn cache clean rm -rf node_modules yarn.lock yarn install
内容的提问来源于stack exchange,提问作者Mohamed Daho
相关产品推荐
相关产品推荐

