我在MyProject Facebook api上使用
Android Studio gradle作为库.请参阅以下设置.
我已经尝试删除support-v4的所有引用(r7或18.0.0)并用support-v13替换它们,但是带有v4的消息仍然存在.我也注意到support-v4-r7出现在外部库中,即使它根本没有被引用.那会是问题吗?
MyProject build.gradle:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android' repositories { mavenCentral() maven { url "https://raw.github.com/ark/ark/master/releases/" } } dependencies { compile 'com.andreabaccega:android-form-edittext:1.0.3' compile 'com.astuetz:pagerslidingtabstrip:1.0.0' compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.12' compile 'com.octo.android.robospice:robospice-spring-android:1.4.7' compile 'com.google.android.gms:play-services:3.1.36' compile files('libs/imageloader-core-1.5.8.jar') compile project(':libs:Facebook') } android { compileSdkVersion 17 buildToolsVersion "18.1" defaultConfig { minSdkVersion 15 targetSdkVersion 17 } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['res'] res.srcDirs = ['res'] } debug { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src','libs/Facebook/src','libs/Facebook/build/source/r/debug','libs/Facebook/build/source/buildConfig/debug'] resources.srcDirs = ['build','libs/Facebook/build/source/buildConfig/debug'] res.srcDirs = ['res'] } } }
MyProject settings.gradle:
include ':MyProject' include ':libs:Facebook'
Facebook build.gradle:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.5.+' } } apply plugin: 'android-library' repositories { mavenCentral() } dependencies { compile 'com.android.support:support-v4:18.0.0' } android { compileSdkVersion 17 buildToolsVersion '18.1' defaultConfig { minSdkVersion 8 } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['res'] res.srcDirs = ['res'] } debug { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src','build/source/r/debug','build/source/buildConfig/debug'] resources.srcDirs = ['build/source/r/debug','build/source/buildConfig/debug'] res.srcDirs = ['res'] } } }
编辑:我已经尝试在另一个项目中逐个添加我在此项目中使用的库,以查看失败的内容.显然这两个人是罪魁祸首.如果我包含其中任何一个或两个,我会收到上述错误.
compile 'com.astuetz:pagerslidingtabstrip:1.0.0' compile 'com.google.android.gms:play-services:3.1.36'
关于如何管理这个的任何想法?
Edit2:显然另一个项目提出了同样的问题.请参阅下面的build.gradle依赖项. StickyListHeaders项目不再包含依赖项.所以我认为这是因为ActionBarSherlock?
dependencies { compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' compile 'com.android.support:support-v4:18.0.+' compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.12' compile 'com.octo.android.robospice:robospice-spring-android:1.4.7' compile project(':Project Base:libs:StickyListHeaders') }