[英]React Native Version mismatch. Cannot generate build in Android Studio but runs properly through VS code react-native run-android
當我從 VS 代碼運行react-native run-android
時,它在我的 android 手機上完美運行。 但是當我嘗試從 android 工作室生成構建時,它向我顯示版本不匹配錯誤。 我已經嘗試了互聯網上的所有解決方案,但都沒有解決我的問題。 請幫幫我。 這件事發生在我將我的 react native 項目版本從0.57.3 升級到 0.58.3 之后。 我什至在整個項目文件夾中搜索,在任何文件或任何文件名或文件夾名稱中都沒有找到這樣的 0.57.3 。 出了什么問題?
React Native 版本不匹配。
Javascript 版本:0.57.3
ReactNative 版本:0.58.3
當您在其他項目的其他地方運行npm start
但在當前項目中運行react-native run-android
時沒有將其關閉時,可能會出現此錯誤。 這會使您當前的 react-native 應用程序嘗試讀取其他項目的 js 包並導致react-native version mismatch
。
嘗試在終端中運行npm start
並查看它是否正確加載了您的 js 包。
after deleting index.android.bundle and then running this command react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
使該錯誤消失了。 因此錯誤現在解決了不知道是否還有其他問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.