Android的工作室停留在"摇篮:解决依赖关系“_debugCompile'"或“detachedConfiguration1” [英] Android Studio stuck on "Gradle: resolve dependancies '_debugCompile'" or 'detachedConfiguration1'
问题描述
我不知道我在我的项目变化,但它突然无法越过这一步,同时建立摇篮脚本。
有没有问题,只是摇篮组装建设它。
编辑:previous卡点是解决依赖关系detachedConfiguration1。 (第一次尝试失败_debugCompile后,我回到了detachedConfiguration1)。 我想这是太多的依赖项目?一些样本项目我都是进口的就好在演播室.... 我重新安装了Android Studio和删除了所有的设置和preferences为好。
我每次开始这样做时将其杀死。
环上的任何钟声?
进口com.android.build.gradle.AppPlugin进口 com.android.build.gradle.LibraryPlugin
//顶级构建文件,你可以添加的配置选项常见 所有子项目/模块。 buildscript { 库{ mavenCentral() }
相关性{ 类路径com.android.tools.build:gradle:0.9.+ }}
应用插件:机器人
库{ 行家{URL<一href="http://ksoap2-android.google$c$c.com/svn/m2-repo">http://ksoap2-android.google$c$c.com/svn/m2-repo' }
mavenCentral()
}
依赖{
编译com.google code.ksoap2-机器人:ksoap2-安卓2.5.2 编译com.android.support:support-v4:18.0.+ 编译文件树(导演:库,包括:的* .jar) 编制项目(':LIB-项目:StickyListHeaders) 编制项目(':LIB-项目:动作条-PullToRefresh) 编制项目(':LIB-项目:Facebook的) 编制项目(':LIB-项目:Mopub:mopub-SDK) 编制项目(':LIB-项目:NineOldAndroids) 编制项目(':LIB-项目:ActionBarSherlock:actionbarsherlock) 编制项目(':LIB-项目:ActionBarSherlock:actionbarsherlock,国际化) 编制项目(':LIB-项目:SmoothProgressBar) 编制项目(':LIB-项目:Android的viewflow主:viewflow')}
安卓{
signingConfigs { 调试{ storeFile文件(....) } } compileSdkVersion 19 buildToolsVersion19.0.3 sourceSets { 主要 { manifest.srcFile的AndroidManifest.xml java.srcDirs = ['src'中] resources.srcDirs = ['src'中] aidl.srcDirs = ['src'中] renderscript.srcDirs = ['src'中] res.srcDirs = ['水库'] assets.srcDirs = ['资产'] } //移动测试,测试/ java中,测试/ RES等... //instrumentTest.setRoot('tests) //将建设各类建设类型/&LT;类型&GT; //例如,构建类型/调试/ java中,构建类型/调试/ AndroidManifest.xml中,... //这会将他们从src下他们默认位置/&LT;类型&GT; / ...这将 //与SRC /冲突正在使用的主要来源集中。 //添加新的构建类型或产品的口味应附有 //通过类似定制。 debug.setRoot(集结类型/调试) release.setRoot(集结类型/释放) }}
我遇到了这个问题,因为我切换到Android工作室过于频繁。这的确是一个问题与库没有被访问 - 无论是由于网络问题,或者更可能的是,回购协议是向下无论出于何种原因
。这是我发现的最简单的解决方法是只需选择脱机工作模式下,Android的工作室preferences内。这不会帮助,如果你需要添加一个新的依赖,但如果你已经把所有的依赖增加它的伎俩。
要启用此设置,请访问:
preferences - >摇篮
在右侧的选项去到全球格拉德尔设置,然后选中脱机工作复选框。
这个盒子应该是这样的:
您可以定期取消选中该复选框,看看是否回购重新联机。
注意:此选项是在命令行中运行的摇篮构建时设置的--offline标志相当于
I have no idea what I changed in my project, but it suddenly cannot get past this step while building gradle scripts.
There is no problem building it with just 'gradle assemble'.
EDIT: the previous stuck point was resolve dependancies 'detachedConfiguration1'. (After the first failed attempt of _debugCompile, I'm back at detachedConfiguration1). I guess it is too many dependency projects? Some sample projects I have are imported just fine in the Studio.... I reinstalled the Android Studio and removed all the settings and preferences as well.
I have to kill it every time it starts doing this.
Ring any bells?
import com.android.build.gradle.AppPlugin import com.android.build.gradle.LibraryPlugin
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() }
dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } }
apply plugin: 'android'
repositories { maven { url 'http://ksoap2-android.googlecode.com/svn/m2-repo' }
mavenCentral()
}
dependencies {
compile 'com.google.code.ksoap2-android:ksoap2-android:2.5.2' compile 'com.android.support:support-v4:18.0.+' compile fileTree(dir: 'libs', include: '*.jar') compile project(':lib-projects:StickyListHeaders') compile project(':lib-projects:ActionBar-PullToRefresh') compile project(':lib-projects:facebook') compile project(':lib-projects:Mopub:mopub-sdk') compile project(':lib-projects:NineOldAndroids') compile project(':lib-projects:ActionBarSherlock:actionbarsherlock') compile project(':lib-projects:ActionBarSherlock:actionbarsherlock-i18n') compile project(':lib-projects:SmoothProgressBar') compile project(':lib-projects:android-viewflow-master:viewflow') }
android {
signingConfigs { debug { storeFile file('....') } } compileSdkVersion 19 buildToolsVersion "19.0.3" 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've encountered this problem far too frequently since i switched over to Android Studio. This is indeed an issue with the repository not being accessible - either due to a network issue or, more likely, the repo being down for whatever reason.
The simplest work-around that I've found is to just select the "work offline" mode within the Android Studio preferences. This doesn't help if you need to add a new dependency, but if you already have all your dependencies added it does the trick.
To enable this setting go to:
Preferences -> Gradle
In the right side options go down to "Global Gradel Settings" and check the "Offline work" box.
The box should look like:
You can periodically uncheck this box to see if the repo is back online.
NOTE: This option is the equivalent of setting the --offline flag when running a gradle build from the command line.
这篇关于Android的工作室停留在&QUOT;摇篮:解决依赖关系“_debugCompile'&QUOT;或“detachedConfiguration1”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!