版权声明:本文为HaiyuKing原创文章,转载请注明出处!
概述
突然想要升级到较高版本。要跟随潮流嘛,不然就落后了。
下载IDE
http://www.wanandroid.com/tools/ide
安装
因为正在删除文件,所以暂时不要操作,等待即可
升级到3.0.1版本后新建项目,会出现下面的提示:Resolved versions for app (26.1.0) and test app (27.1.1) differ
Error:Execution failed for task ':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.
方案一
将project的build.gradle中的gradle版本根据安装提示换成新的
需要翻墙,耐心等待一段时间。
更新gradle版本
此时gradle-wrapper.properties文件的版本号是4.4
编译后提示下面的错误:
Error:FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':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.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
将app/build.gradle文件中的26修改为27
修改为:
方案二:
Build——Rebuild Project
下次打开项目时,还会出现这个问题。
如何实现升级Android Studio到新版本后,新建项目不会出现类似Resolved versions for app (26.1.0) and test app (27.1.1) differ的问题
暂时不知。留待以后解决。