简体   繁体   English

Gradle Error无法在Android Studio中找到com.actionbarsherlock:actionbarsherlock:4.4.0与Eclipse导出的项目

[英]Gradle Error Could not find com.actionbarsherlock:actionbarsherlock:4.4.0 with Eclipse exported project in Android Studio

I have been stuck on this for days/weeks. 我被困在这几天/几周。 I am trying to include the aar for actionbarsherlock and I keep on getting this error: 我试图将aar包含在actionbarsherlock中并继续收到此错误:

Failed to notify project evaluation listener.
    Could not resolve all dependencies for configuration ':_DebugCompile'.
      Could not find com.actionbarsherlock:actionbarsherlock:4.4.0.
          Required by:
           :directory_name:unspecified 

I've done this with a normal application started in Android Studio and it works fine. 我已经在Android Studio中启动了一个正常的应用程序,它工作正常。 My Project is one that was exported from eclipse (with gradle of course). 我的项目是从eclipse导出的项目(当然还有gradle)。 I feel as if it isn't looking through the maven repositories, and there has to be a setting that will fix this. 我觉得好像它没有通过maven存储库查看,并且必须有一个设置来解决这个问题。 Any Help will be appreciated!! 任何帮助将不胜感激!!

build.xml: build.xml文件:

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

dependencies {
    //compile 'com.google.android.gms:play-services:3.1.+'
    compile 'com.android.support:support-v4:18.0.+'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
}

android {
    compileSdkVersion 18
    buildToolsVersion "17.0.0"

    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')
    }
}

Try this: 尝试这个:

buildscript {
    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.5.+'
    }
}
apply plugin: 'android'

repositories{
    mavenCentral()
}

dependencies {
    //compile 'com.google.android.gms:play-services:3.1.+'
    compile 'com.android.support:support-v4:18.0.+'
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
}

android {
    compileSdkVersion 18
    buildToolsVersion "17.0.0"

    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')
    }
}

Notice 2 changes to the repositories section within buildscript, and the addition of repositories in the root. 注意2对buildscript中的存储库部分进行了更改,并在根目录中添加了存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio: Could not find com.android.tools.build:gradle:3.6.2 during import an Eclipse project - Android Studio: Could not find com.android.tools.build:gradle:3.6.2 during import an Eclipse project 将项目导入Android Studio有关ActionBarSherlock的问题 - Problems importing project into Android Studio regarding ActionBarSherlock Android Studio无法与HoloEverywhere和ActionBarSherlock配合使用 - Android Studio not working with HoloEverywhere and ActionBarSherlock 如何在 Android 应用程序中使用 Gradle 导入 ActionBarSherlock? - How to import ActionBarSherlock using Gradle in Android app? 无法使用ActionBarsherlock 4.4.0版读取布局 - Layout cannot be read using actionbarsherlock version 4.4.0 带有ActionBarSherlock的Android项目未构建 - Android Project with ActionBarSherlock doesn't get built 将ActionBarSherlock作为库添加到android项目时出错 - Errors on adding ActionBarSherlock as library to android project 错误:找不到 com.android.tools.build:gradle:3.5.2 - ERROR: Could not find com.android.tools.build:gradle:3.5.2 错误:找不到 com.android.tools.build:gradle:3.5.3 - Error : Could not find com.android.tools.build:gradle:3.5.3 android studio gradle problem: Could not find com.android.tools.build:gradle:3.5.0 - android studio gradle problem : Could not find com.android.tools.build:gradle:3.5.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM