看第一行代码(第二版的)书,讲了一个关于PercentFrameLayout和PercentRelativeLayout的部分,书上在build.gradle中导入了com.android.support:percent:24.2.1的包。
    compile 'com.android.support:appcompat-v7:26.+'    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'    compile 'com.android.support:percent:24.2.1'    testCompile 'junit:junit:4.12'

但Sync后显示错误

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.0.0-alpha1, 24.2.1. Examples include com.android.support:animated-vector-drawable:26.0.0-alpha1 and com.android.support:percent:24.2.1 less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version 所有com.android支持库必须使用完全相同的版本规范(混合版本可能导致运行时崩溃)。发现版本26.0.0-alpha1 24.2.1。例子包括com.android.support:animated-vector-drawable:26.0.0-alpha1 com.android.support:百分比:24.2.1少…(Ctrl + F1)有一些库、工具和库的组合是不兼容的,或者可能导致bug。一个这样的不兼容性是用Android支持库的版本编译,而不是最新的版本(特别是,比你的目标版本低的版本)。

这样就好解决了找到android SDK的文件夹I:\AndroidSDk\extras\android\m2repository\com\android\support\percent
在这里就能看到各种版本的,这里我选择26的26.0.0-alpha1,重新导入,之后重新Sync就可以了!

    compile 'com.android.support:appcompat-v7:26.+'    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'    compile 'com.android.support:percent:26.0.0-alpha1'    testCompile 'junit:junit:4.12'

更多相关文章

  1. Android API Level对应Android版本一览表 到安卓10
  2. android SDK与ADT版本更新问题
  3. Android各版本及API对应关系,持续更新!
  4. Android 所有版本区别总结
  5. Android corners 圆角属性各个版本之间兼容问题
  6. android 更新版本号
  7. Android版本与Android sdk int的对应关系
  8. js调用android的版本兼容问题
  9. Android版本信息汇总

随机推荐

  1. Spring boot 微服务核心组件集 mica v1.0
  2. 基于oauth 2.0 开发第三方开放平台
  3. 变量与常量
  4. Spring 5 core 中的 @NonNull 是个什么鬼
  5. 数据库CURD|常用的select查询|预处理
  6. 扩展 jwt 解决 oauth2 性能瓶颈
  7. 【长文剖析】Spring Cloud OAuth 发放Tok
  8. 解决 nacos 在 Spring boot admin 中不能
  9. mica 微服务核心组件 1.0.0 正式版发布
  10. 微服务架构必备—mica,开源 pro 全部功能