问题描述
我只是一个试图访问Google日历的爱好者程序员。我正在使用Android Studio。我已经从Android SDK管理器下载了所有Google服务并设置了依赖关系。我也试着按照Google的所有文档说明如何在此处执行此操作:,方法是手动添加客户端库到项目的libs文件夹中。
任何时候我都可以的示例脚本声明键入:
import com.google.api.etc ...
无论我以哪种方式执行操作,api总是以红色突出显示,并且说它无法解决。我有权访问驱动器,地图和一堆其他谷歌的东西,而不是日历。
是否有其他人遇到过这个问题?如果是这样,你是如何解决它的?如果您需要更多信息,我很乐意提供。
谢谢!
这就是我的build.Gradle依赖现在的样子:
依赖关系{
compile'com.android.support:appcompat-v7:+'
编译fileTree(包括:['* .jar'],dir:'libs')
编译' com.google.android.gms:play-services:+'
}
在这里打印您的文件的代码Gradle。
您需要它喜欢这里,并将其放入文件build.gradle:
依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
}
UPDATE:
Easify添加方法库,然后你可以把它放到build.gradle文件中:
存储库{
mavenCentral()
}
依赖关系{
编译'com.google.apis:google-api-services-calendar:v3-rev84-1.18.0-rc'
}
I'm just a hobbyist programmer trying to access Google Calendar. I'm using Android Studio. I've downloaded all the Google Services from the Android SDK manager and set the dependencies. I've also tried following all of Google's documentation of how to do this here: Google Developers: Calendar API Client Library for Java, by adding the client libraries manually in the libs folder of the project.
Any time I do any of this the sample scripts say to type:
import com.google.api.etc...
No matter which way I do it "api" always gets highlighted in red and says it cannot be resolved. I have access to drive, maps, and a bunch of other google stuff, just not calendar.
Has anyone else experienced this problem? If so, how did you fix it? If you need more information from me I'd be happy to supply it.
Thanks!
This is what my build.Gradle dependencies currently looks like:
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.google.android.gms:play-services:+'
}
Print here code of your files Gradle.
You need it likes here, and put it into file build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
UPDATE:
Easify method for adding library, then you can put it into file build.gradle:
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.apis:google-api-services-calendar:v3-rev84-1.18.0-rc'
}
这篇关于Android Studio中的Google Calendar API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!