gpt4 book ai didi

java - Gradle 错误 Could not find com.actionbarsherlock :actionbarsherlock:4. 4.0 with Eclipse exported project in Android Studio

转载 作者:太空狗 更新时间:2023-10-29 15:53:52 27 4
gpt4 key购买 nike

我已经坚持了好几天/几周了。我正在尝试为 actionbarsherlock 添加 aar,但我一直收到此错误:

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

我已经使用在 Android Studio 中启动的普通应用程序完成了此操作,并且运行良好。我的项目是从 eclipse 导出的项目(当然还有 gradle)。我觉得好像它没有查看 Maven 存储库,必须有一个设置来解决这个问题。任何帮助将不胜感激!!

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

最佳答案

试试这个:

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

通知 2 更改了构建脚本中的存储库部分,并在根目录中添加了存储库。

关于java - Gradle 错误 Could not find com.actionbarsherlock :actionbarsherlock:4. 4.0 with Eclipse exported project in Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18867570/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com