[英]I am trying to open the React Native application but I have this problem What is the solution?
$ react-native run-android
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- @react-native-community/geolocation (to unlink run: "react-native unlink @react-native-community/geolocation")
- react-native-bluetooth-status (to unlink run: "react-native unlink react-native-bluetooth-status")
- react-native-device-info (to unlink run: "react-native unlink react-native-device-info")
- react-native-i18n (to unlink run: "react-native unlink react-native-i18n")
- react-native-image-picker (to unlink run: "react-native unlink react-native-image-picker")
- react-native-ux-cam (to unlink run: "react-native unlink react-native-ux-cam")
- react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
當將 React Native 從 0.60 以下升級到 0.60 或以上時,可能會發生這種情況。 展望未來,您可以通過“react-native unlink”取消鏈接此依賴項,它將自動包含在您的應用程序中。 如果庫與自動鏈接不兼容,請忽略此消息並通知庫維護者。 閱讀有關自動鏈接的更多信息: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md info 運行 jetifier 將庫遷移到 AndroidX。 您可以使用“--no-jetifier”標志禁用它。 Jetifier 找到 1225 個文件來轉發-jetify。 使用 4 個工人... info JS 服務器已經在運行。 info 正在安裝應用程序... 啟動 Gradle 守護程序,無法重用 1 個不兼容的守護程序,使用 --status 獲取詳細信息
FAILURE:構建失敗並出現異常。
其中:構建文件 'C:\Users\User\Documents\GitHub\walleterp-mobile\node_modules@react-native-community\geolocation\android\build.gradle' 行:21
出了什么問題:評估項目“:@react-native-community_geolocation”時出現問題。
應用插件失敗 [id 'com.android.library']
我在上一個項目中遇到了同樣的問題,您可以嘗試使用以下命令取消鏈接:react-native unlink 並刪除所有依賴項:yarn remove 或 npm-uninstall 然后刪除 yarn.lock、package-lock.json 和 npm-package-lock .json
並刪除文件夾'Android'中的“build”文件夾,然后你可以使用yarn install或npm-install重新安裝,然后嘗試react-native run-android,
我個人創建了一個新項目並重新安裝了所有依賴項,沒有 react-native 鏈接,因為這個錯誤是配置問題,並且出現在新版本的 React Native 中,
希望對你有幫助
只需刪除構建文件夾,然后重試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.