calabash-android运行app-debug.apk引发异常 [英] calabash-android run app-debug.apk throws exception

查看:124
本文介绍了calabash-android运行app-debug.apk引发异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行calabash-android来测试我的应用程序,但是出现以下错误,未进行任何修改的同一个应用程序在尝试进行一些修改之前一直在工作,但是随后我将所有修改都还原为该应用程序:

I am trying to run calabash-android to test my app, but I get the following error, the same app without any modification was working before I tried to do some modifications, but then I reverted all the modifications to the app :

Exception occurred while dumping:
java.lang.IllegalArgumentException: Unknown package: com.bitbar.testdroid
    at com.android.server.pm.Settings.isOrphaned(Settings.java:4134)
    at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18091)
    at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:15508)
    at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:888)
    at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
    at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
    at android.os.ShellCommand.exec(ShellCommand.java:94)
    at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18349)
    at android.os.Binder.shellCommand(Binder.java:468)
    at android.os.Binder.onTransact(Binder.java:367)
    at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
    at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3031)
    at android.os.Binder.execTransact(Binder.java:565)

然后

Success
Success
  Scenario: I can choose a file from the Gallery # features/my_first.feature:3
  HTTPClient::KeepAliveDisconnected: Connection reset by peer @ io_fillbuf - fd:8  (HTTPClient::KeepAliveDisconnected)
  ./features/support/app_life_cycle_hooks.rb:5:in `Before'
    When I take a screenshot                     # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9
    Then I take a screenshot                     # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9

Failing Scenarios:
cucumber features/my_first.feature:3 # Scenario: I can choose a file from the Gallery

1 scenario (1 failed)
2 steps (2 skipped)
0m6.240s

Exception ScreenShot

推荐答案

我通过使用gradle任务运行构建程序来解决了这个问题:app:assembleDebug
在上述例外情况下,calabash找不到软件包名称,因为它在另一个dex类上。
我认为在葫芦中,他们可能对multidex项目有问题,即使不需要,Android Studio也会始终为您的应用启用multidex。
我不是专家,欢迎提出任何建议,我希望某些人可以从此答案中受益。

I solved the problem by running the build using the gradle task :app:assembleDebug in the exception above, calabash can't find the package name, because it is on another dex class. I think in calabash, they may be having problem with multidex projects, and Android Studio will always enable multidex to your app, even if it doesn't need it. I am not an expert, any suggestion are welcome, and I hope some people can benefit from this answer.

这篇关于calabash-android运行app-debug.apk引发异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆