Android Studio Gradle Configuration Errors总结

1. java

Console代码   收藏代码
  1. Error:Configuration with name 'default' not found.  

 这样的错误乍看无从下手,可是gradle提供了一个命令能够进一步地定位具体的错误 android

Cmd代码   收藏代码
  1. gradlew.bat assembleDebug --info  

 此时将获取到进一步的错误信息,好比个人 app

Console代码   收藏代码
  1. FAILURE: Build failed with an exception.  
  2.   
  3. * What went wrong:  
  4. A problem occurred configuring project ':app'.  
  5. > Cannot evaluate module PullToRefresh : Configuration with name 'default' not found.  
  6.   
  7. * Try:  
  8. Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.  
  9.   
  10. BUILD FAILED  

 

 此时能够发现 Cannot evaluate module PullToRefresh 有多是出错的根源,接来下的验证就比较简单了,查看工程目录下有没有把这个module添加进去之类的。 gradle

 

2. ui

 

Console代码   收藏代码
  1. Error:(?, 0) Gradle DSL method not found: 'compile()'  

查看你的application(整个工程)的build.gradle,里面 dependencies 不要包含  lua

Gradle代码   收藏代码
  1. classpath 'com.android.tools.build:gradle:1.3.0'  

 以外的依赖 spa

 

3. debug

Android Studio混淆编译时,Generate Signed APK遇到 ci

Console代码   收藏代码
  1. Execution failed for task ':app:packageRelease'  
  2. Unable to compute hash of XXX\classes.jar  

 返回到cmd里面执行 get

Cmd代码   收藏代码
  1. gradle packageRelease --stacktrace  

 获取到核心err信息

Console代码   收藏代码
  1. java.io.IOException: The same input jar XXX is specified twice  

 解决方法

把proguard-rules.pro中本身定义的 -libraryjars 都注释掉

相关文章
相关标签/搜索