Android Studio com.android.support:percent 导入错误 - 转
2017-08-21 17:00
477 查看
看第一行代码(第二版的)书,讲了一个关于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'
相关文章推荐
- Android Studio com.android.support:percent 导入错误
- build.gradle导入com.android.support:percent 的依赖错误
- Android studio编译错误Could not find com.android.support:appcompat-v7:23.4.0.
- Android Studio "Error:Failed to find: com.android.support:XXXX"错误解决办法
- Android studio提示Android studio 在gradle文件中引入support:appcompat-v7:22.2.0包的时候出现Failed to resolve的错误
- Android百分比布局支持库介绍——com.android.support:percent
- Android studio中导入开源库出现com.android.ide.common.process.ProcessException 错误
- android studio ,gradle 导入项目 常见错误 错误提示:Error:(2, 0) Plugin with id ‘com.github.dcendents.Android-mave
- Android开发:android studio报错: Failed to resolve: com.android.support.constraint:constraint-layout:1.0.
- 解决AS导入Error:(1, 0) Could not find method apply() for arguments [{plugin=com.android.application}]错误
- AndroidStudio使用问题汇总——导入(import)工程时常见错误
- Android百分比布局支持库介绍——com.android.support:percent
- 导入android studio 项目错误:Error:(1, 0) Plugin with id 'com.android.application' not found
- 关于导入moudle遇到的错误Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found解决办法
- IDEA / Android studio 使用gradle 编译 Failed to resolve: com.android.support:appcompat-v7:27.+
- android studio percent support librarys 百分比布局
- gradle编译错误:Conflict with dependency com.android.support:support-annotations
- Android studio "java.lang.NoClassDefFoundError: com/android/util/PropertiesMap"layout错误
- android开发里跳过的坑-AS导入NDK工程提示错误 No such property: sdkHandler for class: com.android.build.gradle.Librar
- Eclipse项目导入到Android Studio时遇到的错误Error: java.util.concurrent.ExecutionException: com.android.ide.comm