zoukankan      html  css  js  c++  java
  • Error:Execution failed for task ':app:preDebugAndroidTestBuild'.错误解决

    在新建布局文件的时候,页面显示:

    design editor is unavailable until a successful build(设计编辑器不可用,直到成功创建。)

    细看下面还有一行错误:

    Error:Execution failed for task ':app:preDebugAndroidTestBuild'.(':app:preDebugAndroidTestBuild'任务执行失败)

    > Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

    ( ':app'.项目中的 'com.android.support:support-annotations' 有冲突,应用是26.1.0,测试应用是27.1.1。)

    解决方法:

    在build.gradle的文件中加入两行代码:

    implementation'com.android.support:appcompat-v7:27.1.1'

    androidTestImplementation'com.android.support:support-annotations:27.1.1'

    同时更正build.gradle中的compileSdkVersion和targetSdkVersion版本为27:

    android {

    compileSdkVersion27

        defaultConfig {

    applicationId"com.example.culif.activitytest"

            minSdkVersion27

            targetSdkVersion27

            versionCode1

            versionName"1.0"

            testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"

        }

    如果出现找不到27.1.1的错误点一下install就可以

    作者:西柚读书
    链接:https://www.jianshu.com/p/efbc0a23d942
    來源:简书
    简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
  • 相关阅读:
    SVN Windows环境搭建,简洁演示
    SVN-linux配置
    链接文本在a标签内标签里也可以用driver.find_element_by_link_text
    selenium python自动化简明演示
    关键字中mysql数据库查询条件带中文无结果解决办法
    python 最短路径
    python 难度分割
    c语言实现一个高铁乘客管理系统
    Linux(Ubuntu)系统安装图文教程
    字符串排序
  • 原文地址:https://www.cnblogs.com/Frank-dev-blog/p/10354847.html
Copyright © 2011-2022 走看看