Idea gradle android 开发问题

本文探讨了Android开发中遇到的依赖配置问题和资源处理问题,并提供了相应的解决方案。通过分析错误日志,发现是由于Android SDK Manager中没有下载特定的Android Support Repository导致依赖无法解析。同时,阐述了在build.gradle文件中引入依赖包时避免使用“+”号的重要性。文章详细介绍了错误原因、解决步骤以及调整后的依赖配置,旨在帮助开发者解决类似问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Idea gradle android 开发问题1:

* What went wrong:

A problem occurred configuring project ':app'.

> Could not resolve all dependencies for configuration ':app:_debugCompile'.

   > 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 > com.facebook.fresco:fresco:0.5.3 > com.facebook.fresco:drawee:0.5.3

         workspace:app:unspecified > com.facebook.fresco:fresco:0.5.3 > 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'.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值