Android 新建工程 卡在Gradle:Resolve dependencies':app:_debugCompile'
2015-04-07 14:00
369 查看
今天更新androidSDK
到5.0,发现新建工程时卡在Gradle:Resolvedependencies':app:_debugCompile'
首先,googledevelop是访问不了的,如果可以就没这事了。(折翼的天使)
其次,我早以在android-studio/bin/idea.properties末尾添加了disable.android.first.run=true
在stackoverflow上也没有很好的解决方案,国外没这问题啊!!
自力更生,首先关闭卡住的androidstudio
打开刚才新建的project的目录在app目录下找到build.gradle
对比以前可以打开得项目的build.gradle
发现多了一行:compile'com.android.support:appcompat-v7:21.0.3'
估计就是这个找不到,需要下载(卡住)
先删除或者注释掉,在重新打开该工程,发现可以启动了
项目内报错:
<style name="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your themehere. -->
public class MainActivity extendsActionBarActivity {
原来是ActionBar惹的祸,或者用Activity代替ActionBarActivity,
android:Theme.Holo.Light.DarkActionBar代替Theme.AppCompat.Light.DarkActionBar
即
如果需要ActionBarActivity,则需要加载com.android.support:appcompat-v7:21.0.3
找到android-support-v7-appcompat.jar加入工程app/libs下
project视图,libs目录,右键android-support-v7-appcompat.jar
as library
在build.gradle中compilefiles('libs/android-support-v7-appcompat.jar')
参考:
http://stormzhang.com/android/2015/03/29/android-support-library/
到5.0,发现新建工程时卡在Gradle:Resolvedependencies':app:_debugCompile'
首先,googledevelop是访问不了的,如果可以就没这事了。(折翼的天使)
其次,我早以在android-studio/bin/idea.properties末尾添加了disable.android.first.run=true
在stackoverflow上也没有很好的解决方案,国外没这问题啊!!
自力更生,首先关闭卡住的androidstudio
打开刚才新建的project的目录在app目录下找到build.gradle
对比以前可以打开得项目的build.gradle
发现多了一行:compile'com.android.support:appcompat-v7:21.0.3'
估计就是这个找不到,需要下载(卡住)
先删除或者注释掉,在重新打开该工程,发现可以启动了
项目内报错:
<style name="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your themehere. -->
public class MainActivity extendsActionBarActivity {
原来是ActionBar惹的祸,或者用Activity代替ActionBarActivity,
android:Theme.Holo.Light.DarkActionBar代替Theme.AppCompat.Light.DarkActionBar
即
如果需要ActionBarActivity,则需要加载com.android.support:appcompat-v7:21.0.3
找到android-support-v7-appcompat.jar加入工程app/libs下
project视图,libs目录,右键android-support-v7-appcompat.jar
as library
在build.gradle中compilefiles('libs/android-support-v7-appcompat.jar')
参考:
http://stormzhang.com/android/2015/03/29/android-support-library/
相关文章推荐
- AndroidStudio Gradle:Resolvedependencies':app:_debugCompile' 问题
- gradle编译出错:Execution failed for task ':app:compileTestDebugJava'.
- gradle编译出错:Execution failed for task ':app:compileTestDebugJava'.
- 关于 Android Studio中的compile 'com.android.support:appcompat-v7:23.+'出现的警告
- 导入工程时出现Unable to resolve target 'android-18' error解决办法
- Error:Execution failed for task ':app:compileDebugNdk' 解决方法
- 导入别的工程的时候出现Unable to resolve target 'android-8'如何解决
- 升级as后,老工程gradle文件出现"dependencies' cannot be applied to '(groovy.lang.Closure)'警告的解决办法
- Android工程出现错误Unable to resolve target 'android-19'
- 解决SDK更新后项目工程Unable to resolve target 'android-**'问题
- [Android Studio][NDK]Execution failed for task ':app:compileDebugNdk'. Error Code:2
- Error:Execution failed for task ':app:mergeDebugResources'. > [style/AppTheme] E:\AndroidSpace\BaseP
- Execution failed for task ':app:compileDebugAidl': aidl is missing
- Android 导入工程出现Unable to resolve target 'android-xx'错误
- Android Eclipse 加载外部工程后错误提示 Unable to resolve target 'android-3'的问题解决
- [Android Studio][NDK]Execution failed for task ':app:compileDebugNdk'. Error Code:2
- Android-Studio Execution failed for task ':app:processDebugManifest'.问题解决