It's a problem when I try to link Google Calendar API in my application on Android.

Asked 1 years ago, Updated 1 years ago, 58 views

http://webnautes.tistory.com/523 We followed the process on the site above. I needed to use Google calendar api in the team project, so I was linking it. I've solved most of the other parts by searching Build.gradle appears to be experiencing an error. The dependencies part dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile ('com.google.apis:google-api-services-calender:v3-rev87-1.19.0') {exclude module: 'httpclient'} compile ('com.google.api-client:google-api-client-android:1.19.0') {exclude module: 'httpclient'} compile ('com.google.http-client:google-http-client-gson:1.19.0') {exclude module: 'httpclient'}

compile 'com.google.android.gms:play-services:5.0.89'

I coded it as } but it was an error Error:(28, 14) Failed to resolve: com.google.apis:google-api-services-calender:v3-rev87-1.19.0 The error occurs. I'm a beginner at Android, so it's not easy to search and solve If you know it, please answer I'd appreciate it!

android api gradle

2022-09-22 22:04

1 Answers

Your Google Api library seems to be too old. Please refer to the code below and modify the build.gradle of the project. (I have confirmed that my environment is building normally.)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.calendarquickstart"
        minSdkVersion 11
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile 'com.google.android.gms:play-services-identity:8.4.0'
    compile('com.google.api-client:google-api-client-android:1.20.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    compile('com.google.apis:google-api-services-calendar:v3-rev125-1.20.0') {
        exclude group: 'org.apache.httpcomponents'
    }

}

Additionally, we recommend that you refer to Google's official documentation that remains up-to-date. (The above code is also extracted from the document below.)

https://developers.google.com/google-apps/calendar/quickstart/android


2022-09-22 22:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.