Android Studio下执行单元测试
作者:网络转载 发布时间:[ 2014/4/28 14:21:57 ] 推荐标签:Android 单元测试
7. gradle-plugin and the gradle version说明:
There is a relation between gradle-plugin and the gradle version. For example
com.android.tools.build:gradle:0.6.+ -> gradle 1.8
com.android.tools.build:gradle:0.7.+ -> gradle 1.9
com.android.tools.build:gradle:0.8.+ -> gradle 1.9/1.10
com.android.tools.build:gradle:0.9.+ -> gradle 1.10/1.11
You can find gradle version used in your project in the file gradle/wrapper/gradle-wrapper.properties
Also there is a relation between gradle-plugin and the IDE version. For example:
Android Studio 0.3.x -> gradle-plugin 0.6
Android Studio 0.4.x -> gradle-plugin 0.7
Android Studio 0.4.3+ -> gradle-plugin 0.8
Android Studio 0.5.x -> gradle-plugin 0.9
For updated news you can check this link: http://tools.android.com/recent
8. 错误问题如下:
!!! JUnit version 3.8 or later expected:
java.lang.RuntimeException: Stub!
at junit.runner.BaseTestRunner.<init>(BaseTestRunner.java:5)
at junit.textui.TestRunner.<init>(TestRunner.java:54)
at junit.textui.TestRunner.<init>(TestRunner.java:48)
at junit.textui.TestRunner.<init>(TestRunner.java:41)
解决方法:(https://github.com/robolectric/deckard-gradle)
For Intellij, go to Project Structure -> Modules -> deckard-gradle pane. In the Dependencies tab, move the Module SDK dependency (i.e. Android API 19 Platform) to be the last item in the list.
For Android Studio, dependency ordering is currently not modifiable via any GUI. Therefore, you must modify the project iml file directly as such and reload the project:
<orderEntry type="library" exported="" scope="TEST" name="wagon-provider-api-1.0-beta-6" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="xercesMinimal-1.9.6.2" level="project" />
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<---make sure this is the last orderEntry
</component>
</module>
9.下载android sdk和platform API参考地址:
http://xtbbbbdx.blog.51cto.com/3506227/1009209
android-3.0_r02-linux.zip的下载链接
http://dl.google.com/android/repository/android-3.0_r02-linux.zip
10: NoClassDefFoundError: com/intellij/rt/execution/junit/JUnitStarter: com/intellij/rt/execution/junit/JUnitStarter
解决方法:???
11. No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
解决方法:
using android-support-v7-appcompat.jar lib inside libs folder
(compile'com.android.support:appcompat-v7:19.0.+')
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11