[英]0 test classes found in package 'drawable' Error in Android Studio
I find an issue when running my project in android studio what i see when i try to run is我在 android 工作室中运行我的项目时发现一个问题,我在尝试运行时看到的是
0 test classes found in package 'drawable'
Process finished with exit code -1
Empty test suite.
Though I have searched for this issue I couldn't find a solution I even tried to invalidate cache and restart the project but still it doesn't works.虽然我已经搜索过这个问题,但我找不到解决方案,我什至尝试使缓存无效并重新启动项目,但它仍然不起作用。 This issue is only being caused for only this particular project however for a new project i make everything works smooth.
此问题仅针对此特定项目引起,但是对于新项目,我使一切顺利进行。
My gradle file我的 gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.jiit.minor2.shubhamjoshi.human"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:design:24.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.firebase:firebase-client-android:2.5.2+'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile 'com.firebaseui:firebase-ui:0.3.1'
compile files('libs/twitter4j-core-4.0.4.jar')
}
My project structure我的项目结构
Thanks In advance.提前致谢。
There is nothing wrong with your project. 您的项目没有任何问题。 This is happening because you are trying to run drawable in app.
这种情况正在发生,因为您正试图在应用程序中运行drawable。 From the drop down select app and then run.
从下拉选择应用程序然后运行。 It will be OK.
一切都会安好的。
I've just had the same error but because my unit-test files were not in the src/test/java
directory (used to be fine in there). 我刚刚遇到了同样的错误,但因为我的单元测试文件不在
src/test/java
目录中(以前就好了)。
Moving the test class files out of their local source directory and into the test one solved it (including a small amount of refactoring to import the classes that required testing). 将测试类文件移出其本地源目录并进入测试版解决了它(包括少量重构以导入需要测试的类)。
For Android Studio's android-tests (not unit-tests), run in bash:对于 Android Studio 的 android-tests(不是单元测试),在 bash 中运行:
./gradlew :createDebugAndroidTestCoverageReport --continue
Which shows actual problem, instead of just not found.这显示了实际问题,而不仅仅是未找到。
For me actual error was:
对我来说,实际错误是:
error: class ActivitySignInTest is public, should be declared in a file named ActivitySignInTest.java
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.