2015-10-13 146 views
1

当我在android studio错误中运行我的应用程序。我是android开发中的新手。无法解析配置':app:_debugCompile'的所有依赖关系。在Android工作室

我Logtag是在这里:

 Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] 
    Error:A problem occurred configuring project ':app'. 
    > Could not resolve all dependencies for configuration ':app:_debugCompile'. 
    > Could not find com.android.support:recyclerview-v7:. 
    Searched in the following locations: 
     https://jcenter.bintray.com/com/android/support/recyclerview-v7//recyclerview-v7-.pom 
     https://jcenter.bintray.com/com/android/support/recyclerview-v7//recyclerview-v7-.jar 
     file:/C:/Users/ANDROID/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7//recyclerview-v7-.pom 
     file:/C:/Users/ANDROID/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7//recyclerview-v7-.jar 
     file:/C:/Users/ANDROID/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7//recyclerview-v7-.pom 
     file:/C:/Users/ANDROID/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7//recyclerview-v7-.jar 
    Required by: 
     ShoppingMazza:app:unspecified 
    Information:BUILD FAILED 
    Information:Total time: 4.964 secs 
    Information:1 error 
    Information:0 warnings 
    Information:See complete output in console 

build.gradle

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.1" 

defaultConfig { 
    applicationId "com.catalyst.android.shoppingmazza" 
    minSdkVersion 16 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 
packagingOptions { 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
} 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:23.0.1' 
compile 'com.android.support:design:23.0.1' 
compile 'com.squareup.picasso:picasso:2.3.2' 
compile 'com.nineoldandroids:library:2.4.0' 
compile 'com.daimajia.slider:library:[email protected]' 
compile 'com.android.support:recyclerview-v7:' 
} 

我在Android开发方面的新的,请帮助。

非常感谢您在这件事上的时间和协助。

+0

请在这里添加你的gradle文件。 – BhumaJ

+0

我说我gradle这个文件 –

+0

编译“com.android.support:recyclerview-v7:”添加版本 –

回答

0

您忘记了版本?在你配置的gradle你应该有这样的事情:

compile 'com.android.support:recyclerview-v7:23.0.1' 
+0

添加此行后,出现错误: - 错误:执行任务':app:dexDebug'失败。 > com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files \ Java \ jdk1.8.0_51 \ bin \ java.exe''以非完成-zero退出值1 - –

+0

编辑您的答案,并发布此追踪 – Jim

1

错误:

Error:A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.android.support:recyclerview-v7:.

从错误,我可以说你就必须添加以下gradle这个依赖性:

compile 'com.android.support:recyclerview-v7:+' 

编辑:

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 1

对于这个错误,我认为你正在编译JAR库的两倍。您在build.gradle文件中使用

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

所以它会编译对libs文件夹罐子扩展名的所有库,这样你就可以删除此行:

compile 'com.squareup.picasso:picasso:2.3.2' 
compile 'com.nineoldandroids:library:2.4.0' 
compile 'com.daimajia.slider:library:[email protected]' 

如果问题仍然存在,那么问题很可能是由于超过了Android强加的65K方法dex限制。通过清理项目并从build.gradle中的依赖关系中删除一些未使用的库和方法,或者通过添加支持,可以解决此问题。

defaultConfig {   
    // Enabling multidex support. 
    multiDexEnabled true 
} 
+0

添加此行后,错误来了: - 错误:执行失败的任务':应用程序:dexDebug'。 > com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程 '命令 'C:\ Program Files文件\的Java \ jdk1.8.0_51 \斌\ java.exe的'' 与完成非零退出值1 –

+0

这是您的compileSDK和targetSDK版本吗? – Rajesh

+0

我的minSdkVersion 16和targetSdkVersion 23和compileSdkVersion 23 –

相关问题