Gradle DSL method not found: 'android()

转载自:http://blog.csdn.net/u012964796/article/details/47000991

原文错误提示:

Error:(16, 0) Gradle DSL method not found: 'android()'
Possible causes:<ul><li>The project ‘XXXXXXX' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>


错误原因:

android studio 引进项目时,自动查找本机是否有项目设置的SDK版本,若发现没有,我们会在project structure修改成自己的SDK。然而,修改后,AS会自动在项目下的build.gradle里添加上以下代码:



解决办法:

删除以上图片中红框中的代码,然后再执行build->Rebuild project,删除完之后的代码如下:


更多相关文章

  1. library project 和android项目
  2. Android顶部工具栏和底部工具栏的简单实现代码
  3. Mono for Android(安卓)V1.0 正式发布啦!
  4. Android应用程序启动过程源代码分析
  5. 利用HTML5开发Android
  6. Android(安卓)滑动手势侦测方法介绍
  7. 用Gradle 构建android程序
  8. android中的UI控制(一)
  9. 如何给你的Android(安卓)安装文件(APK)瘦身

随机推荐

  1. andio:android 音频的代码层次关系
  2. Android(安卓)的 SDK Manager 无法启动
  3. android 程序开发的插件化 模块化方法 之
  4. Android(安卓)恢复出厂设置(recovery)
  5. Android(安卓)ClassLoader解析(2) - Andr
  6. Android(安卓)cupcake源代码获取和编译 f
  7. 学习笔记:原生(android,ios)使用阿里iconf
  8. android web services7
  9. android 屏幕适配问题
  10. 学习android for eclipse