Macaca環境搭建踩坑總結


 

1、使用命令 npm i macaca-android -g 安裝一直不成功,使用Macaca  doctor 一直沒有顯示出android

C:\Users\ABC>npm i macaca-android -g
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated win-spawn@2.0.0: use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) or [cross-spawn-async](https://github.com/Ind
igoUnited/node-cross-spawn-async) instead.
 
> macaca-chromedriver@1.0.40 install C:\Users\ABC\AppData\Roaming\npm\node_modules\macaca-android\node_modules\macaca-chromedriver
> node ./bin/macaca-chromedriver install
 
>> version: 2.33
>> chromedriver cdn url: https://chromedriver.storage.googleapis.com/2.33/chromedriver_win32.zip
internal/streams/legacy.js:59
      throw er; // Unhandled stream error in pipe.
      ^
 
Error: read ECONNRESET
    at exports._errnoException (util.js:1029:11)
    at TLSWrap.onread (net.js:575:26)
C:\Users\ABC\AppData\Roaming\npm
`-- (empty)
 
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "F:\\Appium\\nodejs\\node.exe" "F:\\Appium\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "macaca-android" "-g"
npm ERR! node v7.7.1
npm ERR! npm  v4.1.2
npm ERR! code ELIFECYCLE
 
npm ERR! macaca-chromedriver@1.0.40 install: `node ./bin/macaca-chromedriver install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the macaca-chromedriver@1.0.40 install script 'node ./bin/macaca-chromedriver install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the macaca-chromedriver package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/macaca-chromedriver install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs macaca-chromedriver
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls macaca-chromedriver
npm ERR! There is likely additional logging output above.
 
npm ERR! Please include the following file with any 

 

 修改了一下命令:cnpm  i macaca-android -g 安裝成功

 

2、安裝android驅動,雖然顯示出上面的內容,但沒有真正的安裝成功,報錯信息中有提到:NDK is  missing....之類的,具體信息沒有復制下來

  解決:下載了一個NDK的工具包,放置到android-sdk下,然后配置環境變量,在執行安裝時變沒有提示該錯誤

 

3、報如下錯誤:

Checking the license for package Android SDK Build-Tools 25.0.2 in F:\Appium\android-sdk-windows20171206\licenses
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Build-Tools 25.0.2, Android SDK Platform 26].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android St
udio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licens
es.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Warning: License for package Android SDK Build-Tools 25.0.2 not accepted.
Checking the license for package Android SDK Platform 26 in F:\Appium\android-sdk-windows20171206\licenses
Warning: License for package Android SDK Platform 26 not accepted.
Error: build failed
    at ChildProcess.<anonymous> (C:\Users\AppData\Roaming\npm\node_modules\macaca-android\node_modules\_gradle@1.0.8@gradle\lib\gradle.js:57:1
6)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
[1/3] scripts.install unlock-apk@~1.0.3 finished in 4s
[2/3] scripts.install macaca-chromedriver@~1.0.1 run "node ./bin/macaca-chromedriver install"
>> version: 2.33
>> chromedriver cdn url: https://tnpm-hz.oss-cn-hangzhou.aliyuncs.com/dist/chromedriver/2.33/chromedriver_win32.zip
>> chromedriver local in C:\Users\AppData\Roaming\npm\node_modules\macaca-android\node_modules\_macaca-chromedriver@1.0.40@macaca-chromedriver
\exec\chromedriver2.33.exe
[2/3] scripts.install macaca-chromedriver@~1.0.1 finished in 1s
[3/3] scripts.install uiautomatorwd@~1.0.45 run "node ./scripts/build.js"
Checking the license for package Android SDK Build-Tools 25.0.2 in F:\Appium\android-sdk-windows20171206\licenses
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Build-Tools 25.0.2, Android SDK Platform 26].
  Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android St
udio SDK Manager.
  Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licens
es.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Warning: License for package Android SDK Build-Tools 25.0.2 not accepted.
Checking the license for package Android SDK Platform 26 in F:\Appium\android-sdk-windows20171206\licenses
Warning: License for package Android SDK Platform 26 not accepted.

解決:Android ADK API 26 下載下來,原先沒有下載

 安裝成功提示:BUILD SUCCESSFUL in 1m 48s...

 

4、如提示若下錯誤:說明安卓相關環境沒有配置完全,需要通過Android SDk Manager下載相應的sdk.

  

  Macaca支持Android最低版本為API18, 請注意,另外build-tool請不要安裝預覽版

 

5、TesterHome上關於常見問題記錄:https://testerhome.com/topics/8659

 

6、不接受Android SDK許可協議

 

解決辦法:在android-sdk目錄下在新建一個licenses文件,並創建一個文件為android-sdk-license的文件名,內容為8933bad161af4178b1185d1a37fbf41ea5269c55

     沒有后綴名

 

7、提示Android SDK Platforms directory is not exist, please install the whole thing

   adb 沒有安裝和配置環境變量

8、淘寶鏡像cnpm安裝后提示“不是內部命令”解決方法

  解決方法就是在環境變量里添加cnpm的安裝路徑 一般默認路徑為:C:\Users\Administrator\AppData\Roaming\npm; (這是我的安裝路徑,具體視你的安裝路徑為准)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM