Macaca TypeError: _.uuid is not a function

keith · 2017年05月09日 · 最后由 老马 回复于 2017年05月11日 · 2795 次阅读

$ macaca server -p 3456

responseHandler.js:54:12 [master] pid:1777 Send Error Respone to Client: TypeError: _.uuid is not a function
responseHandler.js:60:14 [master] pid:1777 TypeError: _.uuid is not a function

起 server 后,运行脚本,返回这段日志

之前一直没问题,今天突然这样了,求解!!!!
@xdf

共收到 12 条回复 时间 点赞

我也是碰到了这个问题,应该是在 升级 macaca-android@2.0.0 之后出现的! 这个好处理! 找到报错的代码中 uuid 将后面的 括号去掉即可!
不过这个问题解决后,估计又会报:
cannot stat '/usr/local/lib/node_modules/.app-inspector_npminstall/node_modules/.1.0.2@uiautomatorwd/app/build/outputs/apk/app-debug.apk': No such file or directory
应该是下面的原因: Macaca doctor 中提示!
Command Line Tools: gradle is uninstalled

具体要更新哪个库?

重新 npm i -g macaca-cli 全局更新就好了吗

  1. 下载:gradle 最新版本!
    https://gradle.org/releases

  2. 安装
    Linux & MacOS users
    Unzip the distribution zip file in the directory of your choosing, e.g.:
    $ mkdir /opt/gradle
    $ unzip -d /opt/gradle gradle-3.5-bin.zip
    $ sudo chmod 775 /opt/gradle/
    $ ls /opt/gradle/gradle-3.5
    LICENSE NOTICE bin getting-started.html init.d lib media

3.Step 3. Configure your system environment
Linux & MacOS users
Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:
$ export PATH=$PATH:/opt/gradle/gradle-3.5/bin

再重装 cnpm i macaca-android -g

@xdf
不过重装的时候还是有问题!
$ cnpm i macaca-android -g

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 23].
    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.

BUILD FAILED

Total time: 2.342 secs
(node:70253) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: build failed
Checking the license for package Android SDK Build-Tools 25.0.2 in /Users/caolinming/tools/sdk/licenses
Warning: License for package Android SDK Build-Tools 25.0.2 not accepted.
Checking the license for package Android SDK Platform 23 in /Users/caolinming/tools/sdk/licenses
Warning: License for package Android SDK Platform 23 not accepted.

我也是,和你一样的报错

Error:connect ECONNREFUSED 127.0.0.1:8001

升级新版本后,报错,之后查看 macaca doctor 提示 没有安装 gradle ,请根据http://blog.csdn.net/u014749862/article/details/48982925 执行安装这个工具

mac 系统 gradle 安装方法:
1、sdk install gradle 3.5
2、brew install gradle

$ android sdk

安装 Android SDK Build-Tools 25.0.2

1 保证 android-sdk build-tools 25.0.2 安装 android support repository
2 gradle 配置正常

3 npm uninstall macaca-android -g
npm cache clean
cd /tmp
sudo rm -rf npm*

4 再 npm i macaca-android -g 保证安装日志都是 build successful

5 保证 安装完 macaca-android 后 有这个文件 node-global\node_modules\macaca-android\node_modules\uiautomatorwd\app\build\outputs\apk\app-debug.apk

6 再安装 app-inspector 就 OK 了

详见 https://github.com/alibaba/macaca/issues/550

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