Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidRobot 运行时错误 #27

Open
hanooyang opened this issue Jul 21, 2017 · 7 comments
Open

AndroidRobot 运行时错误 #27

hanooyang opened this issue Jul 21, 2017 · 7 comments

Comments

@hanooyang
Copy link

hanooyang commented Jul 21, 2017

你好,
我将SDK集成到游戏然后编译出来的游戏,GAutomator只能看到控件的XPath,但是不能对控件进行操作,甚至点击固定坐标点都无法完成。查看log发现GAutomator有以下exception:

An exception was thrown by the type initializer for WeTest.U3DAutomation.AndroidRobot 
      at WeTest.U3DAutomation.CommandHandler.InjectTouchEvent()[0x00000] in <filename unknown>:0
      WeTest.U3DAutomation.Logger:w(String)
      WeTest.U3DAutomation.CommandHandler:InjectTouchEvent()
      WeTest.U3DAutomation.CommandHandler:HandleEvent()
      Dynamic.ThirdManager:HandleEvent()
      WeTest.U3DAutomation.U3DAutomationBehaviour:SubUpdate()
      WeTest.U3DAutomation.U3DAutomationBehaviour:Update()```

请问这是什么原因导致的?
@wukenaihe
Copy link
Collaborator

@hanooyang exception信息能够截全一点,就是异常类型也截取进去。

@hanooyang
Copy link
Author

@wukenaihe 不好意思,刚才修改的时候手滑不小心把第一行信息给删掉了
An exception was thrown by the type initializer for WeTest.U3DAutomation.AndroidRobot

@wukenaihe
Copy link
Collaborator

@hanooyang 只有这么多?另外,控件选择之后,GAutomatorView能够用红色正确框出来吗?

@hanooyang
Copy link
Author

@wukenaihe 上边的是我发送点击命令时报的,这里在刚加载游戏时还有一个异常:

Exception has been thrown by the target of an invocation. at System.Reflection.MonoCMethod.Invoke(System.Object obj, BindingFlags invokeAttr, 
System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)[0x00124] in /Users/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:519
at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr,System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)[0x00000] in /Users/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:528
at System.Activator.CreateInstance(System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes)[0x001b8] in /Users/buildslave/mono/build/mcs/class/corlib/System/Activator.cs:338
at System.Reflection.Assembly.CreateInstance (System.String typrName, Boolean ignoreCase, BindingFlags bindingAttr, System.Reflection.Binder binder,System.Object[] args,System.Globalization.CultureInfo culture,System.Object[] activationAttributes)[0x00012] in /Users/buildslave/mono/build/mcs/class/corlib/System.Reflection/Assembly.cs:730
at WeTest.U3DAutomation.AndroidJavaObjectWrapper..ctor(System.String className,System.Object[] args)[0x00000] in <filename unknown>:0
at WeTest.U3DAutomation.CrashMonitor.get_WetestAgent()[0x00000] in <filename unknwon>:0
WeTest.U3DAutomation.Logger:w(String)

我这里拿到的关于GAutomator的log就只有这么多咯

@wukenaihe
Copy link
Collaborator

@hanooyang 你能确认下游戏中是否集成u3dautomation.jar了?可以用反编译看看的。用zip工具打开,然后class.dex用dex2jar转换成jar。jar查看,你可以用jd-gui-windows,看看里面有没有com.tencent.wetest.U3DAutomation

@hanooyang
Copy link
Author

@wukenaihe 我刚才看了一下,确实没有com.tencent.wetest.U3DAutomation。 我们的项目是使用gradle打包的,是不是这个原因呢?如果使用gradle打包,build.gradle该如何配置呢?

@wukenaihe
Copy link
Collaborator

@hanooyang 非常抱歉,这个我们还真没试过,这个可能不太好解答。u3dautomation.jar的打包方式,应该与unity工程中的其他jar打包方式是一样的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants