1

When I am run my application in android studio error. I am new in android developing.

My Logtag is here:

        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

My 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:1.1.5@aar'
compile 'com.android.support:recyclerview-v7:'
}
Zoe
  • 27,060
  • 21
  • 118
  • 148
Anand Jain
  • 2,365
  • 7
  • 40
  • 66

3 Answers3

1

Error:

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

From error i can say you'll have to add the following gradle dependency :

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

EDIT:

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

For this error i think you are compiling JAR library twice. You are using

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

in build.gradle file so it will compile all library that has jar extension on libs folder, so You can remove this lines:

compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'

If issue still exists then issue is quite possibly due to exceeding the 65K methods dex limit imposed by Android. This problem can be solved either by cleaning the project, and removing some unused libraries and methods from dependencies in build.gradle, OR by adding multidex support.

defaultConfig {        
    // Enabling multidex support.
    multiDexEnabled true
}
Rajesh Jadav
  • 12,801
  • 5
  • 53
  • 78
0

Did you forget the version? In your gradle config you should have something like this:

compile 'com.android.support:recyclerview-v7:23.0.1'
Thomas R.
  • 7,988
  • 3
  • 30
  • 39
  • After adding this line the error come:- 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 – – Anand Jain Oct 13 '15 at 09:55
0

In my case, I deleted caches folder inside .gradle folder and then I added compile. It worked for me!

zedunaid
  • 5
  • 1
  • 3