Android的摇篮同步异常,并平滑进度栏项目 [英] Android Gradle sync exception with the Smooth Progress Bar project

查看:175
本文介绍了Android的摇篮同步异常,并平滑进度栏项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加此<一个href=\"http://search.maven.org/#artifactdetails%7Ccom.github.castorflex.smoothprogressbar%7Clibrary%7C1.1.0%7C\"相对=nofollow>库但是当我尝试同步摇篮编译器给我这个错误:

I'm trying to add this library but when I try to sync Gradle the compiler give me this error:

错误:(6,13)无法解析:
  com.github.castorflex.smoothprogressbar:库:1.1.0

Error:(6, 13) Failed to resolve: com.github.castorflex.smoothprogressbar:library:1.1.0

如果这个问题解决了这个问题,我有<一个href=\"http://stackoverflow.com/questions/30025223/exception-trying-to-execute-android-app-from-eclipse-to-android-studio\">this在我的项目的另一个问题张贴在堆栈溢出。

And if that matter to solve this problem, I'm having this other problem in my project posted in stack overflow.

这是它的外观我的项目结构:

This is how it looks my project structure:

这是所有项目的build.grade文件

And this are the build.grade files of all the projects

主要项目整经机(guestperience 1.0.1蒙克洛亚德圣拉萨罗):

Main warper project (guestperience 1.0.1 Moncloa De San Lazaro):

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.0'
    }
}

goSmart.guestperience.MoncloaDeSanLazaro(这是我code):

goSmart.guestperience.MoncloaDeSanLazaro (this is where I code):

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':librarySmartHotel')
    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
}

android {
    compileSdkVersion 16
    buildToolsVersion "22.0.1"

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

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

librarySmartHotel:

librarySmartHotel:

apply plugin: 'com.android.library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':main')
}

android {
    compileSdkVersion 16
    buildToolsVersion '22.0.1'

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

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

主要的:

apply plugin: 'com.android.library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}

android {
    compileSdkVersion 16
    buildToolsVersion '22.0.1'

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

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

我在想,有些配置丢失(也许),真实是我超级丢失。

I'm thinking that some configuration is missing (maybe), the true is that I'm super lost.

唯一想我能看到的是,该库是不是即使在外部库部分下载。

The only think I can see is that the library is not even downloading in the External Libraries section.

更新:

我可以看到在我的Andr​​oid工作室全球的东西,我不能够从另外一个数据存储库添加任何东西。

I can see that is something global in my Android Studio, I'm not able to add anything from another data repository.

推荐答案

您只需要在文件的开头添加这样的:

You just have to add this at the beginning of the file:

repositories {
    mavenCentral()
}

你也可能有离线模式已启用。

检查文件 - >构建,执行,部署 - >的Maven /摇篮脱机工作已启用,如果是的话只要停用它,并同步摇篮

Check if File -> Build,Execution,Deployment-> Maven/Gradle "Offline work" is enabled, if so just disable it and Sync Gradle.

这是所有的。

在我的情况下,我也加入了这一点,因为播放服务的:

And in my case I have also added this because of the Play Services:

defaultConfig {
    multiDexEnabled true
}

您将这样的文件结尾:

应用插件:'com.android.application

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':librarySmartHotel')
    compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
    compile 'com.google.android.gms:play-services:6.5.87'
}

android {
    compileSdkVersion 19
    buildToolsVersion "22.0.1"

    defaultConfig {
        multiDexEnabled true
    }

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

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

这篇关于Android的摇篮同步异常,并平滑进度栏项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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