您現在的位置是:首頁 > 武術

react和codepush一些心得(1)

  • 由 哲學角度思考 發表于 武術
  • 2022-09-28
簡介You can disable it using “——no-jetifier”問題執行 rm node_modules 刪掉依賴 這裡刪除的是自己專案當中的重新裝依賴,注意不要用npm,一定要用yarn install執行 npm r

完美zip怎麼刪除

儘量使用powershell 不使用cmd

按照文件,步驟進行開發,使用cmd各種不適命令

使用powershell可以避免該問題

關於react-native : 無法載入檔案 C:\Users\84922\AppData\Roaming\npm\react-native。ps1問題

1、搜尋框輸入:Windos PowerShell 並且以右鍵管理員身份執行

2、打開了命令列之後,輸入set-ExecutionPolicy RemoteSigned,並且把許可權改許可權為A,然後透過 get-ExecutionPolicy 檢視當前的狀態:

3、最後就可以使用命令了

關於Could not initialize class org。codehaus。groovy。runtime。InvokerHelper的問題

這個是由於gradle 版本不對並且沒有建立loca。properties 檔案導致的

jdk1。8以上的gralder需要配置

distributionUrl=https\://services。gradle。org/distributions/gradle-6。6-all。zip

關於info Running jetifier to migrate libraries to AndroidX。 You can disable it using “——no-jetifier” 問題

執行 rm node_modules 刪掉依賴 這裡刪除的是自己專案當中的

重新裝依賴,注意不要用npm,一定要用yarn install

執行 npm rm /tmp/metro-*

執行 npm run android 完美解決。

補充兩個指令:

進入專案所在目錄後,執行。

1、清除已有的構建結果

cd android && gradlew clean

2、重新構建工程,並自動安裝到手機

cd … && react-native run-android

3。清除yarn快取 yarn cache clean

4。清除npm快取 npm cache clean -f

5。在專案資料夾中有一個package。json 檔案,裡面記錄了該專案所有安裝的依賴環境,若專案檔案出現依賴環境報錯的情況,則可以刪除依賴node_module資料夾,在重新yarn install 一次 , 重新安裝依賴。

6。對於專案出現出現。。。/。。。/debug/。。。/。。/資料夾報錯,可能是快取導致的問題,進入android資料夾下,輸入命令 。/gradlew clean 命令清除快取,也可使用android studio 中的選單按鈕的build下的clean project清除環境,在使用rebuild project 重新跑一次專案。

不要用npm install 個人感覺 rn 對 npm 不太友好,請使用yarn 安裝你需要的模組

以下是參考文件

點這裡 https://www。jianshu。com/p/17f1218aada0

如果還是不行看看你的目錄是不是android目錄下是的話回退到根目錄

react和codepush一些心得(1)

Top