【发布时间】:2022-09-30 22:25:47
【问题描述】:
我正在尝试使用安装页面上的步骤在 Expo 上安装 Notifee:expo install @notifee/react-native,然后将 \"@notifee/react-native\" 添加到我的 app.json 文件中的插件中,然后运行 expo prebuild 但我仍然得到错误Error: Notifee native module not found. 和Invariant Violation: \"main\" has not been registered. 我手动将\"plugins\": [] 添加到我的app.json。我在这里做错什么了吗?
这是我的 app.json 的样子:
{
\"expo\": {
\"name\": \"GymTracker\",
\"slug\": \"GymTracker\",
\"version\": \"1.0.0\",
\"orientation\": \"portrait\",
\"icon\": \"./assets/icon.png\",
\"userInterfaceStyle\": \"light\",
\"splash\": {
\"image\": \"./assets/splash.png\",
\"resizeMode\": \"contain\",
\"backgroundColor\": \"#ffffff\"
},
\"updates\": {
\"fallbackToCacheTimeout\": 0
},
\"assetBundlePatterns\": [\"**/*\"],
\"ios\": {
\"supportsTablet\": true
},
\"android\": {
\"adaptiveIcon\": {
\"foregroundImage\": \"./assets/adaptive-icon.png\",
\"backgroundColor\": \"#FFFFFF\"
},
\"package\": \"GymTracker.app\"
},
\"web\": {
\"favicon\": \"./assets/favicon.png\"
},
\"plugins\": [\"@notifee/react-native\"]
}
}
和我的 package.json:
\"dependencies\": {
\"@expo-google-fonts/inter\": \"^0.2.2\",
\"@notifee/react-native\": \"^5.5.0\",
\"@react-native-async-storage/async-storage\": \"^1.17.7\",
\"@react-navigation/native\": \"^6.0.11\",
\"@react-navigation/native-stack\": \"^6.7.0\",
\"expo\": \"~45.0.0\",
\"expo-font\": \"~10.1.0\",
\"expo-splash-screen\": \"~0.15.1\",
\"expo-sqlite\": \"~10.2.0\",
\"expo-status-bar\": \"~1.3.0\",
\"react\": \"17.0.2\",
\"react-dom\": \"17.0.2\",
\"react-native\": \"0.68.2\",
\"react-native-reanimated\": \"~2.8.0\",
\"react-native-safe-area-context\": \"4.2.4\",
\"react-native-screens\": \"~3.11.1\",
\"react-native-web\": \"0.17.7\",
\"react-navigation-stack\": \"^2.10.4\",
\"react-redux\": \"^8.0.2\",
\"redux\": \"^4.2.0\"
},
标签: react-native plugins linker expo react-native-native-module