与发行的gradle寻找项目建成 [英] Issue with finding gradle built project

查看:136
本文介绍了与发行的gradle寻找项目建成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一些插件 actionbarpulltorefresh ,但在我的code PullToRefreshLayout 不是由IDE解决。这里是我的的build.gradle 文件,问题是,我找不到这个插件的任何源文件,没有在 .gradle 目录

I am using some plugin actionbarpulltorefresh, but in my code PullToRefreshLayout is not resolved by the ide. Here's my build.gradle file, the problem is that I can't find any source file of this plugin, nothing in the .gradle directory

我有一些的build.gradle 文件,该

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}

apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
}

android {
    compileSdkVersion 18
    buildToolsVersion '18'

    defaultConfig {
        targetSdkVersion 18
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
}

编辑:当我把

import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshLayout; 
private PullToRefreshLayout mPullToRefreshLayout;

我得到的消息无法解析符号PullToRefreshLayout
 我使用的版本坐着的IntelliJ Android的工作室基于

推荐答案

您将有更好的运气,如果您升级到一切的新版本:

You'll have better luck if you upgrade to new versions of everything:


  • Android的工作室0.4.3。

  • Android的摇篮插件0.8。你必须编辑的classpath 的build.gradle

classpath 'com.android.tools.build:gradle:0.8.+'


  • 1.10摇篮。你必须编辑 distributionUrl gradle这个/包装/ gradle-wrapper.properties

    distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-bin.zip
    


  • 下载19.0.1 Android SDK中生成工具 SDK管理器和instuct构建你的与此使用它们的build.gradle

  • Download the 19.0.1 Android SDK Build Tools in the SDK Manager and instuct the build to use them with this in your build.gradle:

        buildToolsVersion '19.0.1'
    


  • 有这么固定在一个错误的Andr​​oid 0.4.3工作室,我认为是在你的 actionbarpulltorefresh 图书馆它没有看到类的原因;插件和摇篮的新版本将有必要为您的项目在0.4.3工作。如果升级Android的工作室就应检测插件和摇篮的旧版本,并提供改变他们对你,但如果没有,那么你可以手动编辑。它不会提供更新生成工具版本;你必须做你自己。

    There's a bug that was fixed in Android Studio 0.4.3 that I think is the cause of it not seeing the classes in your actionbarpulltorefresh library; the new version of the plugin and Gradle will be necessary for your project to work in 0.4.3. If you upgrade Android Studio it should detect the old versions of the plugin and Gradle and offer to change them for you, but if it doesn't, then you can edit by hand. It won't offer to update the build tools version; you'll have to do that yourself.

    这篇关于与发行的gradle寻找项目建成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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