Android的测试项目与错误&QUOT崩溃;试运行失败:仪表运行失败,原因是“进程崩溃。'"

编程入门 行业动态 更新时间:2024-10-10 03:24:07
本文介绍了Android的测试项目与错误&QUOT崩溃;试运行失败:仪表运行失败,原因是“进程崩溃。'"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的问题似乎比这里Test运行失败:仪表运行失败,原因是进程崩溃。测试多个Android的活动时结果我跟随在PDF 给步骤。我创建的测试项目TestAndroidCalculatorBlackbox(我们需要有两个项目一个测试,一个主要项目,也许这可能是原因,Robotium事业入门的链接,他们希望我们能够创建记事本项目),并补充罐 robotium独奏-5.0.1.jar , robotium独奏-1.6.0.jar ,下面独奏函数来摆脱红色的错误线和 jay.way包。结果我附上错误截图:ŸAndroidManifest.xml中:搜索

<?XML版本=1.0编码=UTF-8&GT?;<清单的xmlns:机器人=htt​​p://schemas.android/apk/res/android    包=com.testcalculator    安卓版code =1    机器人:=的versionName1.0>    <采用-SDK安卓的minSdkVersion =8/>    <仪器仪表        机器人:名字=android.test.InstrumentationTestRunner        机器人:targetPackage =com.testcalculator/>    <应用        机器人:图标=@绘制/ ic_launcher        机器人:标签=@字符串/ APP_NAME机器人:可调试=真正的>        <使用库机器人:名字=android.test.runner/>    < /用途>< /清单>

和仪器仪表名单上有包说:

C:\\>亚行外壳下午名单仪表仪器仪表:PACKAGE.test.test / android.test.InstrumentationTestRunner(目标= PACKAGE)仪器仪表:PACKAGE.test.test.test.test.test.test / android.test.InstrumentationTestRunner(目标= PACKAGE.test.test)仪器仪表:com.example.android.apis / .app.LocalSampleInstrumentation(目标= com.example.android.apis)>>仪器仪表:com.testcalculator / android.test.InstrumentationTestRunner(目标= com.testcalculator)LT;<

解决方案

  • 不要将多个robotium库。 robotium独奏-1.6.0.jar应该被删除。这是德precated,你真的应该不再使用它。

  • 是您的目标应用程序已经安装?它应该被安装,如果你要为它运行测试。你可以不安装它只有在您的测试项目有参考目标项目。

  • 如果您对应用程序和仪器,你应该在你的清单更改包单独的APK。你确实有com.testcalculator的目标包是相同的 - 他们应该是不同的。顺便说一句,我不看你的项目申请的来源,所以应用部分应该被删除。

  • 您的错误不说多了,这是一件好事,从后栈跟踪LogCat中。

  • 在开始编写测试之前,请阅读手册:

    developer.android/tool​​s/testing/testing_android.html 的https://$c$c.google/p/robotium/w

  • /名单

    My problem seems little different than here Test run failed: Instrumentation run failed due to 'Process crashed.' when testing multiple Android activity I have followed steps given in the pdf. I have created test project "TestAndroidCalculatorBlackbox" (do we need to have two project one test and one main project, perhaps this could be the reason, cause in Robotium "Getting Started" link they want us to create projects for Notepad), and added jars robotium-solo-5.0.1.jar,robotium-solo-1.6.0.jar, to get rid of red error lines below solo. functions and jay.way package. I am attaching the error screenshot: y AndroidManifest.xml:

    <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="schemas.android/apk/res/android" package="com.testcalculator" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" /> <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.testcalculator" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:debuggable="true"> <uses-library android:name="android.test.runner" /> </application> </manifest>

    and I have package added in instrumentation list:

    c:\> adb shell pm list instrumentation instrumentation:PACKAGE.test.test/android.test.InstrumentationTestRunner (target=PACKAGE) instrumentation:PACKAGE.test.test.test.test.test.test/android.test.InstrumentationTestRunner (target=PACKAGE.test.test) instrumentation:com.example.android.apis/.app.LocalSampleInstrumentation (target=com.example.android.apis) >> instrumentation:com.testcalculator/android.test.InstrumentationTestRunner (target=com.testcalculator) <<

    解决方案

  • Don't attach more than one robotium library. robotium-solo-1.6.0.jar should be removed. It's deprecated and you really shouldn't use it anymore.

  • Is your target application already installed? It should be installed, if you are going to run tests for it. You can not install it only if your test project has reference to target project.

  • If you have separate APKs for application and instrumentation you should change package in your manifest. You actually have "com.testcalculator" and target package is the same - they should be different. By the way I don't see sources of application in your project, so application part should be removed.

  • Your error doesn't say much, it's always good to post stacktrace from LogCat.

  • Read manuals before you start writing tests:

    developer.android/tools/testing/testing_android.html code.google/p/robotium/w/list

  • 更多推荐

    Android的测试项目与错误&QUOT崩溃;试运行失败:仪表运行失败,原因是“进程崩溃。'&QUOT;

    本文发布于:2023-11-25 06:31:25,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1628683.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:进程   仪表   错误   原因   测试

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!