1. 程式人生 > >Android CTS測試中./cts-tradefed出現Unable to find aapt in path 解決方案

Android CTS測試中./cts-tradefed出現Unable to find aapt in path 解決方案

cts測試,本來測試得好好的,關閉終端後重新開啟,再次開啟,執行./cts-tradefed命令出錯,顯示Unable to find aapt in path

 解決方案:

1.安裝aapt

輸入sudo apt-get install aapt

安裝成功後重新輸入./cts-tradefed

2.如果以上方案還沒有解決,可以嘗試去out 目錄下將out/host/linux-x86/bin/aapt放到某個目錄下(如:/usr/bin/),將該目錄(如:/usr/bin/) 新增到 PATH 中去。

export PATH=$PATH:~/tools/bin/

如果採用第二種方案後面又報錯,apk installed but AaptParser failed

可以看出還是aapt的問題 。可以嘗試執行一下aapt,發現又報錯了:

aapt: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

可以看出是找不到libc++.so檔案,於是在linux-x86目錄下搜尋,複製到/usr/lib下,重新執行aapt,發現aapt可以運行了。

嘗試./cts-tradefed未報錯。