Android Studio找不到导入的库 [英] Android Studio can't find imported library

查看:386
本文介绍了Android Studio找不到导入的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Android Studio(0.5.3)中导入了一个库

I've imported a library in Android studio (0.5.3)

我的settings.graddle看起来像这样:

My settings.graddle looks like this:

include ':app', ':libs:Android-PullToRefresh-master'

我的build.graddle看起来像这样:

And my build.graddle looks like this:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.1'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.android.support:support-v4:19.+'
    compile 'com.google.android.gms:play-services:4.2.42'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    project(':libs:Android-PullToRefresh-master');
}

我下载的文件夹位于app文件夹下的libs文件夹中.而且,gradle同步和构建不会提供任何错误.但是,每当我尝试导入import com.handmark.xxxxxx;时,都会出现错误cannot resolve symbol 'handmark'.我选择了项目结构,并且该应用程序在列表中具有依赖项.

The folder I've downloaded is placed in the libs folder directly under the app folder. Also the graddle syncs and building doesn't provide any error. Yet whenever I try to import import com.handmark.xxxxxx; I get the error cannot resolve symbol 'handmark'. I've chcecked to project structure and the app has the dependency in the list.

出了什么问题,我该如何解决?

What is going wrong and how can I fix this?

推荐答案

我在这里遇到了同样的问题,并且在Google+的"Android开发者工具"社区中提出了问题.亚历克斯·鲁伊斯(Alex Ruiz)进行了交谈,并告诉我:

I ran into the same issue here and asked the question on the "Android Developer Tools" Google+'s community. Alex Ruiz picked up the conversation and told me:

我能够重现此问题.不幸的是,目前还没有更新.我们 目前正在修复项目结构"(核心 基础架构),我们希望很快就能实现.

I'm able to reproduce this issue. Unfortunately, no updates yet. We are currently fixing the "Project Structure" (the core infrastructure,) and we will get to this, hopefully soon.

所以他们知道了,但是我们仍然要等到修复它.

So they are aware of it but we still have to wait until they fix it.

这篇关于Android Studio找不到导入的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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