
我的build.gradle依赖项:
dependencIEs {// Ok Configcompile filetree(dir: 'libs',include: ['*.jar'])testCompile 'junit:junit:4.12'compile 'com.androID.support:appcompat-v7:23.2.1'compile 'com.androID.support:design:23.2.1'compile 'com.androID.support:support-annotations:23.2.1'androIDTestCompile 'com.androID.support.test.espresso:espresso-core:2.2.2'androIDTestCompile 'com.androID.support.test:runner:0.5'androIDTestCompile 'com.androID.support:support-annotations:23.2.1'androIDTestCompile 'com.androID.support.test.espresso:espresso-intents:2.2.2'androIDTestCompile 'com.androID.support.test.espresso:espresso-contrib:2.2.2' 该项目编译并执行正常,但是当我尝试运行测试时,它会因此错误而崩溃:
java.lang.IllegalStateException: You need to use a theme.AppCompat theme (or descendant) with this activity
尽管错误的文本我使用theme.AppCompat的后代主题,所以我根本不理解错误消息.
有人有同样的问题吗?它似乎与appcompat和espresso的依赖关系有任何问题,但我无法找到它并解决我的问题.
有任何想法吗?
谢谢!
解决方法 我认为主要问题是espresso模块使用的支持库与我项目中使用的支持库不同,所以当我尝试运行测试时,测试会崩溃.最后我解决了它,除了所有espresso模块的支持库,强制他们使用我的项目的支持库.现在一切都很好.希望这可以帮助任何人!
我的gradle看起来像这样:
compile 'com.androID.support:appcompat-v7:23.2.1' compile 'com.androID.support:design:23.2.1' compile 'com.androID.support:support-annotations:23.2.1' androIDTestCompile ('com.androID.support.test:runner:0.5') { exclude group: 'com.androID.support' } androIDTestCompile ('com.androID.support.test:rules:0.5') { exclude group: 'com.androID.support' } androIDTestCompile ('com.androID.support.test.espresso:espresso-core:2.2.2') { exclude group: 'com.androID.support' } androIDTestCompile ('com.androID.support.test.espresso:espresso-contrib:2.2.2') { exclude group: 'com.androID.support' } androIDTestCompile ('com.androID.support.test.espresso:espresso-intents:2.2.2') { exclude group: 'com.androID.support' } 总结 以上是内存溢出为你收集整理的android – AppCompat库23.2.1不使用espresso v2.2.2全部内容,希望文章能够帮你解决android – AppCompat库23.2.1不使用espresso v2.2.2所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)