Macaca macaca 环境搭建——从开始到放弃

碎冰之殇 · 2018年03月12日 · 最后由 jiben1270352189 回复于 2020年03月21日 · 5240 次阅读

macaca 环境搭建——从开始到放弃,哦不……是完成,emm 是完成……对完成……

  • 基本环境需要准备的东西:
    • JDK 的安装及环境配置;(1.8)
    • Node.js 的安装及环境配置;(8+)
    • android SDK 安装及环境配置;(25+)
    • gradle 安装及环境配置;(5.6.4-android28.0.3)
    • Xcode[mac] 安装及环境配置;(9+)【ctrl+F,搜一下本帖关于 mac 的安装注意事项哦!】
  • macaca 的安装及配置:
    • 安装 macaca-cli
    • 安装 macaca-android 或 ios
    • 安装 app-inspector

以上每个步骤安装完都需要校验和检查,不然后边会引发很多不好解决的麻烦。

安装详解

首先,建议大家在安装各个软件的时候:1.文件夹的名字尽量不要有中文(日文也不行!);2.文件夹的名字尽量不要有空格;3.尤其是 jdk、nodejs,他们很挑剔的~;
(感谢@quxin-31楼童鞋的提醒)

1.JDK

安装及环境变量配置,还有安装后的校验,点击跳转链接链接跳转查看,本文不详说;

2.Node.js

** 1. node.js 官网,下载安装 左侧的稳定版,如图示

** 2. 安装 Node.js


一路下一步,中间需要更改安装目录,默认是在 C 盘;

安装完毕(新版自带 npm),cmd-打开命令行窗口,输入如下命令校验安装是否成功,如图示
node -v
npm -v

** 3.npm 的环境变量配置 **
在安装的文件夹【xx\nodejs】下创建两个文件夹【node_global】及【node_cache】如下图:

然后 cmd-打开命令窗口输入如下两条命令,配置的是 npm 安装的全局模块所在的路径,以及缓存 cache 的路径
npm config set prefix "D:\Develop\nodejs\node_global"
npm config set cache "D:\Develop\nodejs\node_cache"
注意,请根据自己安装的路径,修改上边两条命令后边的路径信息
然后进入环境变量对话框,
在【系统变量】下新建【NODE_PATH】,输入【D:\Develop\nodejs\node_global\node_modules】
在【用户变量】下的【Path】修改 npm 的路径为【D:\Develop\nodejs\node_global】

另外,天朝的我们还要修改一下下载源的地址,cmd-命令行窗口输入如下命令即可
npm config set registry https://registry.npm.taobao.org
切换到国内的淘宝镜像地址,下载更快速。
这里有淘宝源的镜像地址,可以到这里取你想要的 node 等组件
4.测试
配置完后,安装个 module 测试下,我们就安装最常用的 express 模块,打开 cmd 窗口,
输入如下命令进行模块的全局安装:
npm install express -g ** # -g 是全局安装的意思 **

3.android SDK 安装及配置

1.首先是下载
点击链接跳转,在页面下方,选择对应系统的 sdk-tools 下载安装就可以了。
当然,你还可以将上边的 android studio 一同下载了,这个工具可以帮助你做 android 的开发,在环境搭建上也能帮你一键搞定

2.sdk-manager 中的下载选择
不废话,直接看图
注意:说明一下,这里必须安装Android SDK Build-tools 25.0.2以上的版本,其他都会可能出问题,建议 28.0.3。

下载好图中标注的所需的文件(API 推荐 18+ 版本,一般要很长时间……)
3.配置一下这个 sdk 的环境变量
创建系统变量 ANDROID_HOME,变量值:xxx\sdk(以你安装目录为准,确认里面有 tools 和 add-ons 等多个文件夹),点击确认。
在系统变量 path 中添加;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;
然后验证一下,cmd 命令行窗口:adb,出现一堆英文;android 启动 sdk-manager;

这里补充一个下载 SDK 及组件各个版本的地址,点击跳转

4.gradle 的安装及配置

如果你没有安装 android studio,或者安装了旧版本,那么推荐你重新下载并安装新版的 gradle,这是一个构建工具,作用同 ant;
点击链接跳转下载,如图,建议下载 5.6.4

安装完成后,环境变量的配置开始:
在【系统变量】中添加【GRADLE_HOME】D:\Gradle\gradle-5.6.4(你的 gradle 根目录)
在【系统变量】中添加【path】%GRADLE_HOME%\bin;(你的 gradle 解压目录下的 bin 文件夹)
校验一下,cmd 命令行窗口:gradle -v,显示版本号即可。
❗ 由于在 macaca-android 的安装中需要无误(uiautomatowd@1.1.1 目前最低支持 28.0.3 的),这里目前必须安装 5.6.4 版本的,请不要安装最新的哦~!(当然后边你可以自己通过配置文件来修改,但是没有这种方法直接)

以上工作完毕已经,我们开始 macaca 的安装及配置

5.macaca 的安装

cmd 打开命令行窗口,开始 macaca 的安装
1.macaca-cli 核心框架
npm i macaca-cli -g
当你的界面出现了一只惊悚的猴子,那么就是安装成功了,如图

2.校验 macaca 环境
macaca doctor
出现如下的一片原谅色表明环境 OK,如果有红色,请针对错误单独解决。

3.根据需要安装驱动,比如 android 或 ios
npm i macaca-ios -g
npm i macaca-android -g
注意安装过程中是否有报错,有错误请观察日志并解决,这里是最容易出现问题的地方;
如果安装成功了,以 android 为例,应该在这个目录下会生成这两个 apk 文件,如果没有,请自行解决,或找高人指点;
注意路径是 xx/nodejs/node-global/... .../outputs/,根据你自己的安装目录去找(如果 gradle 版本和 android 版本不匹配,会报错,即不生产该 debug.apk)

4.安装 app-inspector
如果第三部 OK 的话,我们来安装元素查找器,也就是和 monitor 一样功能的控件
npm i app-inspector -g
确保如下命令中有手机或模拟器的连接,可以取得设备 ID
adb devices
启动 app-inspector 的命令
app-inspector -u 设备 id

以上,整个框架搭建完毕,个别细节请留言咨询。我再做补充

6.MAC-IPhone

补个 MAC 安装爱疯真机时的注意事项:

1.安装 usbmuxd 以便于通过 USB 通道测试 iOS 真机
$ brew install usbmuxd
2.安装 ideviceinstaller 用来给真机安装 App
$ brew install ideviceinstaller
3.应用中如含有 WebView,请安装 ios-webkit-debug-proxy
$ brew install ios-webkit-debug-proxy
4.安装 macaca-ios 驱动
请使用公司统一的 TEAM_ID 安装:
DEVELOPMENT_TEAM_ID=XXXXX npm install macaca-ios -g --registry=https://registry.npm.taobao.org
5.替换 xctest_client 文件(默认路径/usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd.js)
app-inspector(录制工具) 具路径为 (默认路径/usr/local/lib/node_modules/app-inspector/node_modules/xctestwd.js)
6.审核 webview,native **
**7.安装 macaca-cli 命令行工具

npm install macaca-cli -g --registry=https://registry.npm.taobao.org
安装完成后,检查环境是否配置成功,结果如有标红则需要处理:$ macaca doctor

注意:接口在 ios 12.2+ 已经修改,真机联调 webview 不要用高版本

共收到 57 条回复 时间 点赞
碎冰之殇 macaca 搭建过程——报告老板,开始排坑 中提及了此贴 03月12日 19:16

mac 环境的呢?

dustin 回复

我这暂时只有 windows 的配置,等我有钱了一定买个 mac 用……T.T

本来是想来看怎么放弃的,结果你成功了

超级详细啊

sdsds 回复

必须的~

coolfish 回复

困难重重~

Node.js 的安装及环境配置;(6+)一定需要 6+ 的版本么?

hello 回复

是的,一定要 6+ 的版本才行,官方指定的

达峰的夏天 解决 Macaca 安装慢的问题 中提及了此贴 03月20日 14:44
碎冰之殇 回复

多谢,我试试,升级后遇到一个诡异的问题。

碎冰之殇 回复

macaca doctor 这个报错:Not accepted Android SDK license agreements @xdf 是什么问题呢?

碎冰之殇 macaca 搭建过程——报告老板,开始排坑 中提及了此贴 03月27日 13:28

我安装全局模块的时候就报错了。。

大佬,我的有问题啊,请加我 v:WeiboGe2012
我都整蒙了

楼主这个路径有木有写错呀。。这两个文件夹不是同一级目录下的吗。。

王梦茹 回复

木有写错哦~,这个文件夹实际上有 2 种建的方法,这是其中的一种

涛哥 回复

好绿啊……
话说,推荐你按照安装步骤,把 macaca 及其组件都清理掉,包括文件夹和缓存文件,然后重新安装一遍,不然会越错越多的

dustin 回复

mac 差不多,不过需要 xcode 支持,不知道是不是因为账号的缘故,在安装 APP 时说找不到

晚上给楼主加根鸡腿

请教下,我其他的都安装成功了,就是在 C:\nodejs\node_global\node_modules\macaca-android\node_modules\uiautomatorwd\app 下面没有生成 APK,这是为何? @rogerleo

刘刘刘 回复

那就是安装失败了……,检查一下上边 sdk 所需的组件是否都有正确下载,然后卸载干净 Android 和 inspector 并重新安装,安装完 Android 的时候就检查一下是否有正确生成 apk,然后再继续下一步安装;
还有个临时解决办法:自己在网上搜一下那两个 app,直接下载下来扔到对应的目录就 ok;

碎冰之殇 回复

这是我的 macaca -doctor
这是我的 SDKManager
关键是我的 SDK 里为啥没有 25.0.2 的版本呢?删除 Android,是直接手动删除吗?

刘刘刘 回复

首先,你的 SDK Tools 没有升级,所以版本根本对应不上,就算后边安装完也会报错;
其次,这个是必须安的,不然你就没有 app 生成

再者,doctor 只能证明你安了,但是不能表示安装完整了,需要运行验证;
最后,Android 的卸载有卸载命令,然后清缓存命令,再去删除相关文件夹


这样算成功吗大佬

我在搭建 macaca 跑了一段时间的 web 和 Android 自动化之后, 是真的放弃了它,web 改回用 selenium, Android 改用 atx , 省心好多。

豆包 回复

看图说不出话……,成功以后,会有 success 的提示的

Jerry li 回复

我从来不用 macaca 做 web 的……

你好,我想问下关于 uirecorder 使用的问题,请问 1.安卓录制怎么直接打开应用为不是每次都安装呢 2.run 用例的时候遇到 error 和断言 fail 就会停止,不继续执行,但是 macha 回放脚本就会全部执行,但是回放脚本不生成报告,请问可以设置吗

建议加一个 sdk,nodejs 安装路径不要有空格的建议。

瞧瞧 回复

可以有~

chenhuipeng1 回复

这位童鞋看来没仔细看官方文档~
一、配置启动参数中有一个 reuse,0: 启动并安装 app。1 (默认): 卸载并重装 app。 2: 仅重装 app。3: 在测试结束后保持 app 状态。
二、关于断言停止的问题可以研究一下多线程之类的东东;找到回放的源码本身就不会有报告,不然会很繁琐,有兴趣可以自己添加修改;

碎冰之殇 回复

我的意思是。。 在录制开始时怎么不设置 apk 路径(或者没有 apk 包),直接打开手机内已安装的应用
也许是我没理解你的意思。。

mark,已完成安装!
建议没搞定的同学要用 cnpm,会减少很多坑!

有个问题:
deprecate xctestwd@1.4.0 ? xcode@0.8.9 ? node-uuid@1.4.7 Use uuid module instead
deprecate xctestwd@1.4.0 ? request@2.69.0 ? node-uuid@~1.4.7 Use uuid module instead
deprecate xctestwd@1.4.0 ? request@2.69.0 ? tough-cookie@~2.2.0 ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
deprecate xctestwd@1.4.0 ? request@2.69.0 ? hawk@3.1.3 ? hoek@2.x.x The major version is no longer supported. Please update to 4.x or newer

这个咋处理?

chenhuipeng1 回复

不设定怎么知道要运行什么……

laoyu 回复

这个不就是建议升级版本么?

macaca doctor 是全绿的。但是安装安装 macaca-android 一直是这个问题,尝试了各种办法都无法解决,请问楼主这个问题应该怎么解决。万分感谢 。

C:\Users\sharl>npm install -g macaca-android
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 hoek@2.16.3: This version is no longer maintained. Please upgrade to the latest version.
npm WARN deprecated boom@2.10.1: This version is no longer maintained. Please upgrade to the latest version.

macaca-chromedriver@1.0.44 install D:\nodejs\node_global\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
chromedriver local in D:\nodejs\node_global\node_modules\macaca-android\node_modules\macaca-chromedriver\exec\chromedriver2.33.exe

uiautomatorwd@1.0.60 install D:\nodejs\node_global\node_modules\macaca-android\node_modules\uiautomatorwd
node ./scripts/build.js

(node:5444) UnhandledPromiseRejectionWarning: ,

Configure project :app
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to D:\android-sdk-windows\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

Checking the license for package Android SDK Platform 26 in D:\android-sdk-windows\licenses
Warning: License for package Android SDK Platform 26 not accepted.
,
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 Platform 26].
    Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio 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-licenses.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

(node:5444) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:5444) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

unlock-apk@1.0.8 install D:\nodejs\node_global\node_modules\macaca-android\node_modules\unlock-apk
node ./script/build.js

(node:1352) UnhandledPromiseRejectionWarning: ,

Configure project :app
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to D:\android-sdk-windows\ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.

Checking the license for package Android SDK Platform 26 in D:\android-sdk-windows\licenses
Warning: License for package Android SDK Platform 26 not accepted.
,
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 Platform 26].
    Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio 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-licenses.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

(node:1352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

  • macaca-android@2.0.48 added 157 packages from 117 contributors in 12.276s

我想问,哪个是你的报错?因为这里边好多错误需要解决……

碎冰之殇 回复

已经搞定了,我把 android-sdk 全删了,SDK tool 安装 25.0.2,API 装 26,然后就全好了

恩,最好的处理方式~

大佬帮我看看这是哪里错了

我也遇到到了同样的问题,你解决了吗?

yszj 回复

清理手机内的 macaca 相关组件 3 个,重新安装驱动即可

45楼 已删除

老板帮看下问题 多
谢,按照你的教程最后一步出现这种情况可否帮忙看下多谢
这是 doc 上的报错信息
PS C:\Windows\system32> app-inspector -u eed8df5

UIAutomatorWD http server ready
Android device started: eed8df5
inspector start at: http://192.168.1.99:5678
<-- GET /
The source may be wrong, please check your app or report with below message at:
https://github.com/macacajs/app-inspector/issues/new
****** SOURCE START *******
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>



'****** SOURCE END *******

TypeError: Cannot read property 'bounds' of undefined
at adaptor (C:\Program Files\nodejs\node_global\node_modules\app-inspector\lib\android.js:28:14)
at Object.exports.dumpXMLAndScreenShot (C:\Program Files\nodejs\node_global\node_modules\app-inspector\lib\android.js:59:12)
at exports.dumpXMLAndScreenShot.next ()
at onFulfilled (C:\Program Files\nodejs\node_global\node_modules\app-inspector\node_modules_co@4.6.0@co\index.js:65:19)
at process._tickCallback (internal/process/next_tick.js:68:7)

<-- GET /
浏览器页面出现:Internal Server Error

先看下 doctor 有没有问题,看看各个组件版本是否更新可用。
另外:安装目录不允许有空格

碎冰之殇 回复

那就尴尬了,你这个 Macaca 做 web 测试不好吗,不好管理吗,还是有更溜的工具

wenzhaoxian 回复

不,只是我习惯了 selenium

仅楼主可见
52楼 已删除
小丸子 回复

可以的


求教楼主,上面一切环境搭建好之后,怎么开始下一步工作,进入自动化工作呢


请问 LZ,输入了启动命令 app-inspector 以后没有任何反应,浏览器也没自动启动。是啥情况呀?

小丸子 回复

拿起编译器,开始编写自动化代码;(官网有例子)
打开模拟器,启动本地服务,获取你需要的元素

exdevilgod 回复

先检查下配置的环境,检查手机连接,检查是否开启了 usb 调试等,检查浏览器是否正确按照及配置变量。
如果还不行,就重新装载 app-inspector

仅楼主可见
frankfong9 回复

放弃吧 windows 就好好搞 Android 的。ios 就去 mac。虽然也有模拟器可以用,但是很麻烦且不容易实现

大佬,安装 macaca-android 一直报错请问是什么问题呀?



下载失败,是不是 npm 下载源没有设置成国内的,淘宝 NPM 镜像,你可以 sou 一下

请楼主帮我看看这个问题,主要是加粗那一段。万分感谢🙏 🙏 🙏 !@ 碎冰之殇

  • cmd C:\Users\Administrator>cnpm i macaca-android -g Downloading macaca-android to D:\Program Files\nodejs\node_global\node_modules\macaca-android_tmp Copying D:\Program Files\nodejs\node_global\node_modules\macaca-android_tmp_macaca-android@2.1.0@macaca-android to D:\Program Files\nodejs\node_global\node_modules\macaca-android Installing macaca-android's dependencies to D:\Program Files\nodejs\node_global\node_modules\macaca-android/node_modules [1/10] webdriver-dfn-error-code@~1.0.1 installed at node_modules_webdriver-dfn-error-code@1.0.4@webdriver-dfn-error-code [2/10] driver-base@~0.1.0 installed at node_modules_driver-base@0.1.4@driver-base [3/10] macaca-utils@1.0.0 installed at node_modules_macaca-utils@1.0.1@macaca-utils [4/10] xml2map@1.0.2 installed at node_modules_xml2map@1.0.2@xml2map [5/10] unlock-apk@1.1.1 installed at node_modules_unlock-apk@1.1.2@unlock-apk [6/10] macaca-adb@~1.0.3 installed at node_modules_macaca-adb@1.0.34@macaca-adb [7/10] xlogger@~1.0.0 installed at node_modules_xlogger@1.0.6@xlogger [8/10] temp@~0.8.3 installed at node_modules_temp@0.8.4@temp [9/10] uiautomatorwd@1.1.0 installed at node_modules_uiautomatorwd@1.1.1@uiautomatorwd [10/10] macaca-chromedriver@~1.0.1 installed at node_modules_macaca-chromedriver@1.0.45@macaca-chromedriver execute post install 3 scripts... [1/3] scripts.install unlock-apk@1.1.1 run "node ./script/build.js", root: "D:\Program Files\nodejs\node_global\node_modules\macaca-android\node_modules\_unlock-apk@1.1.2@unlock-apk" (node:3620) UnhandledPromiseRejectionWarning: ,Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

Configure project :app
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Checking the license for package Android SDK Build-Tools 28.0.3 in E:\SDK\android-sdk-windows\licenses
License for package Android SDK Build-Tools 28.0.3 accepted.
Preparing "Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)".
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" ready.
Installing Android SDK Build-Tools 28.0.3 in E:\SDK\android-sdk-windows\build-tools\28.0.3
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" complete.
"Install Android SDK Build-Tools 28.0.3 (revision: 28.0.3)" finished.
Checking the license for package Android SDK Platform 26 in E:\SDK\android-sdk-windows\licenses
License for package Android SDK Platform 26 accepted.
Preparing "Install Android SDK Platform 26 (revision: 2)".
"Install Android SDK Platform 26 (revision: 2)" ready.
Installing Android SDK Platform 26 in E:\SDK\android-sdk-windows\platforms\android-26
"Install Android SDK Platform 26 (revision: 2)" complete.
"Install Android SDK Platform 26 (revision: 2)" finished.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
,
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.
    > Failed to notify project evaluation listener.
    >org.gradle.api.file.ProjectLayout.fileProperty(Lorg/gradle/api/provider/Provider;) Lorg/gradle/api/file/RegularFileProperty;

  • 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 1m 13s

(node:3620) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:3620) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[1/3] scripts.install unlock-apk@1.1.1 finished in 1m
[2/3] scripts.install uiautomatorwd@1.1.0 run "node ./scripts/build.js", root: "D:\Program Files\nodejs\node_global\node_modules\macaca-android\node_modules\_uiautomatorwd@1.1.1@uiautomatorwd"
(node:13532) UnhandledPromiseRejectionWarning: ,

Configure project :app
WARNING: Configuration 'androidTestCompile' is obsolete and has been replaced with 'androidTestImplementation' and 'androidTestApi'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'androidTestApi' is obsolete and has been replaced with 'androidTestImplementation'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (25.0.2) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.2.1.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '25.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
,
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

    Failed to notify project evaluation listener.
    org.gradle.api.file.ProjectLayout.fileProperty(Lorg/gradle/api/provider/Provider;) Lorg/gradle/api/file/RegularFileProperty;

  • 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

(node:13532) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:13532) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[2/3] scripts.install uiautomatorwd@1.1.0 finished in 2s
[3/3] scripts.install macaca-chromedriver@~1.0.1 run "node ./bin/macaca-chromedriver install", root: "D:\Program Files\nodejs\node_global\node_modules\macaca-android\node_modules\_macaca-chromedriver@1.0.45@macaca-chromedriver"

version: 2.33
chromedriver cdn url: https://cdn.npm.taobao.org/dist/chromedriver/2.33/chromedriver_win32.zip
chromedriver local in D:\Program Files\nodejs\node_global\node_modules\macaca-android\node_modules_macaca-chromedriver@1.0.45@macaca-chromedriver\exec\chromedriver2.33.exe
[3/3] scripts.install macaca-chromedriver@~1.0.1 finished in 3s
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › node-uuid@~1.4.7 Use uuid module instead
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › hawk@~3.1.0 This version has been deprecated. Please upgrade to the latest version to get the best features, bug fixes, and security patches.
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › hawk@3.1.3 › sntp@1.x.x This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › hawk@3.1.3 › cryptiles@2.x.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › hawk@3.1.3 › boom@2.x.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › tough-cookie@~2.2.0 ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
deprecate macaca-chromedriver@1.0.45 › request@2.69.0 › hawk@3.1.3 › hoek@2.x.x This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
All packages installed (156 packages installed from npm registry, used 1m(network 3s), speed 1.04MB/s, json 139(290.53kB), tarball 3.21MB)

TL-cj 回复

你看看输入 gradle -v 能不能输出 gradle 的版本,不能的话,就是和我一样的问题,把 gradle 版本降低就可以了,我用的是 5.5 的版本,就可以运行了

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册