【React-native】安卓運行報錯 Could not install the app on the device, read the error above for details.


 RN在IOS運行一切正常,準備去Android端測試發現報錯,但是我設備啓着的,於是乎根據提示./gradlew installDebug,卻說我Permission denied


造成原因:gradlew權限不足導致react-native run-android失敗

解決方案:

執行如下命令:

chmod +x gradlew

錯誤截圖: 


錯誤:安卓運行後報錯,在android/app/src/main/下創建assets文件夾,運行如下腳本即可。

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/

 錯誤:如果此後第一次運行可以啓動,雙擊R時不顯示。

我虛擬機之前抓包連接了代理服務器,關掉即可,供參考。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章