:app:compileDebugGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugGroovy'.
> Unable to load class android.support.v4.app.Fragment due to missing dependency android/support/v4/view/LayoutInflaterFactory
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.063 secs
Unable to load class android.support.v4.app.Fragment due to missing dependency android/support/v4/view/LayoutInflaterFactory
配置文件(root)
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } }app
apply plugin: 'com.android.application' apply plugin: 'groovyx.grooid.groovy-android' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.misty.xxx.app" minSdkVersion 19 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } lintOptions { abortOnError false } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'org.codehaus.groovy:groovy:2.4.4:grooid' compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:support-v4:22.2.1' }
<p>
<br>
</p>
<p>
<br>
</p>
其实后来已经找到解决办法,就是再运行一次build即可。只要clean后build就会报错,再build就正常。可能是GroovyAndroid插件的bug。
超时?你用代理了吗不是超时,是编译的时候找不到依赖的类LayoutInflaterFactory
发一下build.gradle文件是如何配置的呗~
配置已加,谢谢玩的好潮…体验如何?
compilefileTree(dir:'libs',include:['*.jar'])
这一行不建议,尽可能走maven,不要把这些jar包扔到项目目录下
回复<aclass='referer'target='_blank'>@Feng_Yu:我经常在不同电脑上开发,直接把jar连同项目推到git上,方便。你说的这种也用,不过是直接发布到local-repo里,没有搭私服回复<aclass='referer'target='_blank'>@Ellipse:还可以搭建maven的私服(比如用nexus或者artifactory,都容易实现),把自己的jar包作为工程build结果上传到maven私服中解决。maven写清楚依赖,构建就容易的多,不用自己一个个下载jar包了,也不用在build.gradle写每一个jar包的依赖了了解,这行主要是把自己写的jar放到项目里。其他都走maven的版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。