装了个Android Studio,编译的时候,提示
Failure [INSTALL_FAILED_OLDER_SDK],不管怎么换编译版本都不行。
最终在StackOverflow上找到答案了,app/build.gradle 中的这两行问题
compileSdkVersion 'android-L'
buildToolsVersion '20.0.0'
换成你电脑中下载的其它版本的SDK和buildTools版本就可以了。
原因是:这android-L于其之前的版本不兼容,甚至是21也不兼容。
If you compile against a preview SDK (android-L), the build tools will lock minSdkVersion and targetSdkVersion to that same API level.
。如果使用android-L编译,那么编译工具就会将minSdkVersion 和 targetSdkVersion 锁定到android-L。
所以换一下就会好了。
stackoverflow 帖子在这:
点击这里
遇到Android Studio编译提示Failure [INSTALL_FAILED_OLDER_SDK]?通过调整app/build.gradle文件中的compileSdkVersion和buildToolsVersion即可解决问题。文章详细解释了原因,并提供了在StackOverflow上的解决方案链接。

9176

被折叠的 条评论
为什么被折叠?



