Macaca macaca 运行报错,其中的坑

hello · February 21, 2017 · Last by dingdan replied at July 04, 2018 · 2889 hits

macaca安装正常:macaca doctor命令显示如下

模拟器Genymotion启动正常

adb devices -l命令显示如下
List of devices attached
192.168.81.102:5555 device product:vbox86p model:Samsung_Galaxy_Note_2_4_2_2API_17__720x1280 device:vbox86p

macaca服务启动信息如下

运行报错:

com.alibaba.fastjson.JSONException: syntax error, pos 1, json : Internal Server Error
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1361)
at com.alibaba.fastjson.parser.DefaultJSONParser.parse(DefaultJSONParser.java:1268)
at com.alibaba.fastjson.JSON.parse(JSON.java:137)
at com.alibaba.fastjson.JSON.parse(JSON.java:128)
at com.alibaba.fastjson.JSON.parseObject(JSON.java:201)
at macaca.client.common.Utils.postRequest(Utils.java:104)
at macaca.client.common.Utils.request(Utils.java:144)
at macaca.client.commands.Session.createSession(Session.java:35)
at macaca.client.MacacaClient.initDriver(MacacaClient.java:1164)
at macaca.client.H5Mobile.setUp(H5Mobile.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

java.lang.NullPointerException
at macaca.client.common.Utils.deleteRequest(Utils.java:120)
at macaca.client.common.Utils.request(Utils.java:146)
at macaca.client.commands.Session.delSession(Session.java:45)
at macaca.client.MacacaClient.quit(MacacaClient.java:1188)
at macaca.client.H5Mobile.tearDown(H5Mobile.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


sever log如下

问题已经解决:原因是nodejs的安装路径有空格,不能放在 C:\Program Files,C:\Program Files (x86)下面。否则出现如上莫名奇妙的错误。

这两天学习折腾macaca,把目前遇到的坑和解决办法总结一下:
No1,nodejs的安装路径不能有空格,SDK的安装目录也是不能有空格的,原因不明,希望macaca团队看看解决一下。
No2,macaca.webdriver.client这个2.0.1jar包下载不下来,原因是maven私服镜像配置问题。参考
No3,macaca-chrome驱动,IOS驱动等安装失败,删除临时文件夹C:\Users\你的用户\AppData\Local\Temp夹下npm开头的文件夹,重新执行命令就好了小马的macaca入门指引合集**
No4,Genymotion模拟器安装app失败,Failure [INSTALL_FAILED_CPU_ABI_INCOMPATIBLE]。你可能需要安装Genymotion-ARM-Translation_v1.1.zip

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 11 条回复 时间 点赞

错误不断,好心累啊

@harsayer :帮忙看看,谢谢了。 💐

4Floor has been deleted

macaca所在路径有空格,建议更改安装路径。

#5楼 @adfghzhang node的路径?

#6楼 @success macaca所在的路径,也是因为你的node全局安装路径的原因。修改一下吧

#7楼 @adfghzhang 已经搞定了,就是这个空格的问题,多谢指点

android sdk的安装路径有空格的话,也会有问题的

hello #10 · February 24, 2017 作者
王华林 回复

哦。还好,我的sdk目录没有空格,少踏一个坑。

这是个大坑

我的回放错误大神,

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up