Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Why is gradle complaining about not finding appcompat-v7.jar? #17

Closed
lucas-dev opened this issue Oct 2, 2016 · 7 comments
Closed

Why is gradle complaining about not finding appcompat-v7.jar? #17

lucas-dev opened this issue Oct 2, 2016 · 7 comments
Labels

Comments

@lucas-dev
Copy link

so I'm adding the library as a depency like this:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:design:24.1.1'
    ...
    compile 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
}

But when trying to sync the project with Gradle, I get this:

Warning:Module 'com.android.support:appcompat-v7:24.1.1' depends on one or more Android Libraries but is a jar
Error:A problem occurred configuring project ':app'.
> Could not find appcompat-v7.jar (com.android.support:appcompat-v7:24.1.1).
  Searched in the following locations:
      https://jcenter.bintray.com/com/android/support/appcompat-v7/24.1.1/appcompat-v7-24.1.1.jar

I know that the problem is caused by the library, because when I delete that line the project syncs successfully.

This is the full app/build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.boel.demorv"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:design:24.1.1'
    compile 'com.android.support:cardview-v7:24.1.1'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    compile 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4'
}

So, why is gradle complaining about not finding appcompat-v7.jar in https://jcenter.bintray.com/com/android/support/appcompat-v7/24.1.1/appcompat-v7-24.1.1.jar?

Thanks in advance! I really want to use this library.

@luizgrp
Copy link
Owner

luizgrp commented Oct 11, 2016

Hi, sorry for the delay in replying, has it been fixed?
I updated all the dependencies of the example project in my local machine and it's working fine. Could you please try with the app project and see if you get the same error?

@lucas-dev
Copy link
Author

thanks for the answer! I fixed the problem by manually adding the library files to my project.
If I try to add the library with gradle, as shown in the sample code, I still get the error.
I was suggested to update the Support Library to the latest version, but these days I'm not having access to an internet connection capable of downloading large software updates.
Do you think that updating the Support Library would fix the problem? And if so, why is that the solution?
Sorry but I can't test that possible solution right now :(

@luizgrp
Copy link
Owner

luizgrp commented Oct 12, 2016

No problem! I don't think updating the support library will fix the problem, the example project is working fine with support library 23.1.1.

Try adding the dependency like this:

compile ('io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4') {
        exclude group:'com.android.support', module:'appcompat-v7'
}

@lucas-dev
Copy link
Author

lucas-dev commented Oct 12, 2016

Thanks again for the support luizgrp! Unfortunately, the proposed solution didn't fix the problem.
I'm attaching a screenshot of my Android Studio installation with the message from the gradle build.

screenshot from 2016-10-12 20-24-24

I'll let you know if I find a solution.

@luizgrp
Copy link
Owner

luizgrp commented Oct 12, 2016

ok, now it is complaining about recyclerview instead of appcompat, so try again with:

compile ('io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.0.4') {
        exclude group:'com.android.support', module:'appcompat-v7'
        exclude group:'com.android.support', module:'recyclerview-v7'
}

@lucas-dev
Copy link
Author

It's working now! Could you please explain what is going on here? I don't understand why the sectionedrecyclerviewadapter is conflicting with the appcompat and the recyclerview.

BTW, should I close this issue right now?

@luizgrp luizgrp closed this as completed Feb 7, 2017
@luizgrp luizgrp added the invalid label Apr 1, 2017
@ferfesh
Copy link

ferfesh commented Aug 17, 2020

I fixed the problem by manually adding the library files to my project

I am also facing the same problem
please
Can you tell me how to manually add it to your app?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants