Android Studio.2.2和Gradle包不存在 [英] Android Studio .2.2 and Gradle package does not exist

查看:316
本文介绍了Android Studio.2.2和Gradle包不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的Android Studio和导入外部Java库。我已阅读关于配置Gradle依赖关系的文章,并且修复了我的第一个包不存在的错误。


$ b 这些是我的MainAcitivity.java文件中的导入语句:

  import com.google.android.gms.common.GooglePlayServicesUtil; 
import com.google.api.client.extensions.android.http.AndroidHttp;
导入om.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.tasks.TasksScopes;

这里是我的build.gradle文件的依赖语句。

 依赖关系{
编译'com.android.support:support-v4:13.0.+'
编译'com.google.android。 gms:play-services:3.1.36'

我碰巧偶然发现一篇文章,修复导入 GooglePlayServicesUtil Gradle包错误。



我需要为其他6个外部导入添加其他依赖关系,但不知道如何找出它们的名称,因为我不清楚它为什么 import com.google.android.gms.common.GooglePlayServicesUtil; 映射到 compile'c​​om.google.android.gms:play-services:3.1 .36'



如何查找其他导入到依赖关系映射的其他6个外部库?



com.google.api.client.extensions.android.http.AndroidHttp;



com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;



com.google.api.client.http.HttpTransport;



com。 google.api.client.json.JsonFactory;



com.google.api.client.json.gson。 GsonFactory;



com.google.api.services.tasks.TasksScopes;



真的在找ho的方法w $ / $>

感谢您的帮助!

解决方案添加这些依赖项:

  compile('com.google.api-client:google-api-client -android:1.17.0-rc'){
exclude module:'httpclient'
}
compile('com.google.http-client:google-http-client-gson:1.17 .0-rc'){
排除模块:'httpclient'
}

请参阅此示例


New to Android Studio and to importing external Java libs. I have read the posts on configuring Gradle dependencies and I fixed my first package does not exist error.

These are the import statements from my MainAcitivity.java file:

import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.api.client.extensions.android.http.AndroidHttp;
import om.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.services.tasks.TasksScopes;

and here are my dependencies statements from the build.gradle file.

dependencies {
    compile 'com.android.support:support-v4:13.0.+'
    compile 'com.google.android.gms:play-services:3.1.36'

I happened to stumble upon a post that specifically mentioned how to fix the import GooglePlayServicesUtil Gradle package error.

I need to add the add the other dependencies for the other 6 external imports but don't know how to find out what to name them as it is not clear to me why import com.google.android.gms.common.GooglePlayServicesUtil; maps to compile 'com.google.android.gms:play-services:3.1.36'

How do I find out what the other import to dependency mappings are for the other 6 external libs?

com.google.api.client.extensions.android.http.AndroidHttp;

com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential;

com.google.api.client.http.HttpTransport;

com.google.api.client.json.JsonFactory;

com.google.api.client.json.gson.GsonFactory;

com.google.api.services.tasks.TasksScopes;

Really looking for the method on how to do this with any external imported java lib.

Thanks for your help!

解决方案

Add these dependencies:

compile ('com.google.api-client:google-api-client-android:1.17.0-rc') {
    exclude module: 'httpclient'
}
compile ('com.google.http-client:google-http-client-gson:1.17.0-rc') { 
    exclude module: 'httpclient'
}

See this example

这篇关于Android Studio.2.2和Gradle包不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆