---
title: "Idea gradle android 开发问题"
author: "simon_zhang"
date: "2015-07-28T15:38:53Z"
tags: []
categories: ["移动开发"]
slug: "idea-gradle-android"
draft: false
lastmod: "2015-07-28T15:53:31Z"
id: 2230913
url: "https://mogee.iteye.com/blog/2230913"
---

Idea gradle android 开发问题1:

\* What went wrong:

A problem occurred configuring project ':app'.

&gt; Could not resolve all dependencies for configuration ':app:\_debugCompile'.

   &gt; Could not find com.android.support:support-v4:21.0.3.

     Searched in the following locations:

         http://nexus.cabletech.com.cn/content/groups/public/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom

         http://nexus.cabletech.com.cn/content/groups/public/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar

         https://repo1.maven.org/maven2/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom

         https://repo1.maven.org/maven2/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar

         https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom

         https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar

     Required by:

         workspace:app:unspecified &gt; com.facebook.fresco:fresco:0.5.3 &gt; com.facebook.fresco:drawee:0.5.3

         workspace:app:unspecified &gt; com.facebook.fresco:fresco:0.5.3 &gt; com.facebook.fresco:imagepipeline:0.5.3

         

解决办法：

一般都是因为Android SDK Manager中没有下载Extras下的Android Support Repository 

没有下载导致的。

 参考：http://vjson.com/wordpress/could-not-find-com-android-support.html

 

Idea gradle android 开发问题2:

\* What went wrong:

Execution failed for task ':app:processArmeabiDebugResources'.

&gt; com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\\android-sdk\\sdk\\build-tools\\22.0.1\\aapt.exe'' finished with non-zero exit value 1

 

解决方法：

在build.gradle中引入的依赖包中不能使用“+”。

之前：

dependencies {

    //compile fileTree(dir: 'libs', include: \['\*.jar'])

    compile 'com.android.support:appcompat-v7:22.2.+'

    compile 'com.google.code.gson:gson:2.3.1'

    //compile 'com.squareup.picasso:picasso:2.5.2'

    //compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'

    compile 'de.greenrobot:eventbus:2.4.0'

    compile 'com.facebook.fresco:fresco:0.5.3'

    compile 'com.squareup.okhttp:okhttp:2.4.0'

    //compile 'com.squareup.retrofit:retrofit:1.9.0'

    compile('com.mikepenz:materialdrawer:3.1.2@aar') {

        transitive = true

    }

    compile 'com.android.support:design:22.2.+'

    compile 'com.mikepenz:octicons-typeface:2.2.0@aar'

    compile 'com.rengwuxian.materialedittext:library:2.1.4@aar'

    compile files('libs/AMap\_3DMap\_V2.4.1.jar')

    compile files('libs/Android\_Location\_V1.3.2.jar')

    compile files('libs/Android\_Navi\_V1.1.2.jar')

    compile files('libs/Msc.jar')

    compile files('libs/AMap\_Services\_V2.4.0.jar')

之后：

dependencies {

    //compile fileTree(dir: 'libs', include: \['\*.jar'])

    compile 'com.android.support:appcompat-v7:22.2.0'

    compile 'com.google.code.gson:gson:2.3.1'

    //compile 'com.squareup.picasso:picasso:2.5.2'

    //compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'

    compile 'de.greenrobot:eventbus:2.4.0'

    compile 'com.facebook.fresco:fresco:0.5.3'

    compile 'com.squareup.okhttp:okhttp:2.4.0'

    //compile 'com.squareup.retrofit:retrofit:1.9.0'

    compile('com.mikepenz:materialdrawer:3.1.2@aar') {

        transitive = true

    }

    compile 'com.android.support:design:22.2.0'

    compile 'com.mikepenz:octicons-typeface:2.2.0@aar'

    compile 'com.rengwuxian.materialedittext:library:2.1.4@aar'

    compile files('libs/AMap\_3DMap\_V2.4.1.jar')

    compile files('libs/Android\_Location\_V1.3.2.jar')

    compile files('libs/Android\_Navi\_V1.1.2.jar')

    compile files('libs/Msc.jar')

    compile files('libs/AMap\_Services\_V2.4.0.jar')