我一直在使用google play服务库只是与google +登录,它工作得很好,但现在我想包括日历API到我的应用程序。我遵循这个教程
问题是新教程的依赖会在Gradle Build中引起警告。
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources]
Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkDebugManifest
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex100Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
Information:2 warnings
:app:mergeDebugAndroidTestResources UP-TO-DATE
Information:See complete output in console
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
Information:BUILD SUCCESSFUL
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
Information:0 errors
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
Information:Total time: 10.856 secs
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareDebugDependencies
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
这是我的gradle app文件:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('C:/Users/Julio/.android/debug.keystore')
storePassword 'android'
}
}
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.julio.competicionpartido"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.config
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile ('com.google.api-client:google-api-client:1.20.0'){
exclude module: 'httpclient'
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
compile 'com.google.api-client:google-api-client-android:1.20.0'
compile 'com.google.api-client:google-api-client-gson:1.20.0'
compile 'com.google.apis:google-api-services-calendar:v3-rev125-1.20.0'
}
我一直在寻找,我已经尝试了所有的方法。有人能帮我吗?
为了从所有配置中排除该类:
configurations.all() {
exclude group: "org.apache.httpcomponents", module: "httpclient"
}
dependencies {
...
}
我可以通过从所有配置中排除模块httpclient来修复错误。将此代码添加到您的公会。gradle文件:
configurations {
compile.exclude group: "org.apache.httpcomponents", module: "httpclient"
}
我是这样解决的。
我已经集成了google+登录,并与我的应用程序共享。我只是删除了API客户端的依赖,只是我只使用了谷歌播放服务的依赖,它为我工作。
compile 'com.google.api-client:google-api-client-android:1.20.0
'- remove it
和
只要使用compile 'com.google.android.gms:play-services:7.5.0'
就可以了