如何调试或解决“错误:当前项目无法运行".适用于Android Instrumented测试的运行配置? [英] How to debug or resolve "Error: The current project can not be run" for Run Configuration for Android Instrumented Tests?

查看:343
本文介绍了如何调试或解决“错误:当前项目无法运行".适用于Android Instrumented测试的运行配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目(通过此 StackOverflow问题),该问题具有模块 Android Instrumented Test .它可以通过选择模块的常规配置运行.

I have a project (created via this StackOverflow question) that has a module with an Android Instrumented Test. It can be run via a normal Configuration where the module is selected.

这适用于Android Gradle插件< = 2.2.3和> = 3.0.0-beta1.但是,一旦我将项目更改为Android Gradle项目2.3.x(2.3.0-> 2.3.3),我就会得到以下错误消息用于运行配置:

This works for Android Gradle plugin <=2.2.3 and >=3.0.0-beta1. But as soon as I change the project to Android Gradle project 2.3.x (2.3.0 -> 2.3.3) I get this error message for my run configuration:

我找不到以任何方式获取更多信息或调试此错误消息的方法.在此窗口或其他任何地方都不会突出显示任何内容.

I found no way to get more information or debug this error message in any way. There is nothing highlighted in this window or anywhere else.

有什么想法会导致这种情况吗? 如何调试此错误消息以找出我的项目出了什么问题?

Any idea what could be causing this? How can I debug this error message to find out what is wrong with my project?

推荐答案

尝试从Android Studio中的命令行运行检测的测试. 命令为./gradlew connectedAndroidTest.这应该可以告诉您发生了什么.

Try running the Instrumented tests from the command line in Android Studio. The command is ./gradlew connectedAndroidTest . This should give you an indication of what's going on.

此外,请确保您正在运行模拟器或插入了设备.

Also, make sure that you have an emulator running or a device plugged in.

这篇关于如何调试或解决“错误:当前项目无法运行".适用于Android Instrumented测试的运行配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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