-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library leakcanary-android-1.3 is not in list of external libraries #9
Comments
That's really strange, Can you paste the dependency tree here? |
Also:
|
LeakCanary is not available, but LeakTrace and LeakTraceElement are available. Here is dependency tree:
|
update: after performing Build->Clean Project it finally appeared :) |
Alright, that's weird. Well, let's close then. |
interesting, i'm noticing this same issue with one of my projects. as is someone else on SO :P http://stackoverflow.com/questions/30158104/square-leakcanary-cannot-find-symbol. my guess was some gradle foo that was stripping it out. odd though that the analyzer and watcher dependencies show up. Oddly, just as i looked at this and ran a Build > Clean Project, it started appearing again. I could have sworn this didn't work before. oh well... i did try it out at 2am in the morning. that could have been the problem. though, i'm curious to know what about the dependencies got the project to that state. |
arr. actually i was looking at a different project ><. still running into the issue where leakcanary-android dependency not showing up. |
Are you sure you are not using another variant than debug or release? |
Same issue as Kaushik and other people on S.O. |
Here's the setup for that project (where i'm noticing the issue): List of Variants in the project:
Gradle version 2.1 I notice that the gradle version(s) on this project are super old. Not sure if that's causing any issues (i'm a complete groovy/gradle newb so can't tell). Another thing i notice that's a little different about this project is that i use multiple independent java subProjects (but doubt that should have to do with anything). After doing a clean project build, i only notice the watcher and analyzer as seen below: |
just wanted to say that i had the same problem. No matter what i do, no om.squareup.leakcanary.LeakCanary available, but after i cleaned the project in the build menu in Android Studio, it worked. |
@eikaramba can you post the specifics (as i did in a previous comment) of your environment and project. that might help fish out the problem. i (and some other folks on SO) tried the Build->Clean Project and it didn't work. i'm beginning to think this is a gradle versioning problem possibly :S but upping the version doesn't seem like a 10 minute task for my current project; so having more details would be helpful before i embark on alternative routes (especially given that the build > clean solution is not working for everyone). |
sure, List of Variants in the project:
Gradle version 2.4 |
I've tried everything (I think) but still no luck. I've clean the project many times but that has no effect. |
@RobertoIDL Can you provide the gradle version + android plug version + android studio version? |
@pyricau Sure! Gradle version: 2.2.1 |
I just encountered the same issue. Finally I solved it by adding
Before the |
@timrau just tried that solution and didn't work. sure it was not a red herring for another issue? ( i already had mavenCentral declared in the repositories section. tried removing other declarations to see if there was any conflict etc. didn't seem to have an effect) |
@kaushikgopal I'm not pretty sure indeed. |
@kaushikgopal @RobertoIDL what error do you get when building from the command line? |
So the thing is, there's no "error" per say. it's just that the dependencies aren't getting pulled down properly. I realize i haven't clearly explained the issue anywhere. so i'll paste down my steps in detail here:
It's crazy cause on multiple greenfield projects that i've tried, everything gets pulled down without any issues. There's some setting or instruction that's "conflicting" with the existing project, that's preventing the (if that's not the info you're looking for, do let me know and i'll add in more details). |
I had this problem as well. What did solve the problem is the end was removing this from gradle:
|
hey @mvarnagiris ; would it be possible for you to change for what it's worth, i don't have that setting in my gradle file :S (would be interesting to check the default). |
With |
Yep that's the opposite error. @kaushikgopal what's the output of |
had this issue too. but for me |
this is strange. I got it to work now:
i see leakcanary-android now ! #win. I'm not sure how or what changed, probably the clean build from command line flushes out some cached config :S ? In any case solved for me. Thanks folks! @RobertoIDL give a shot and clean build from command line (alternatively the unexplainable crazy procedure i just listed above) and see if it works for you. |
In my case, I had a custom buildType buildTypes {
bypass {
// Some parameters
}
} I just had to use |
Hi @kaushikgopal I've just tried but no luck. I'll keep investigating tomorrow, this shouldn't be this difficult :) At least you got it working. |
Alright. Anyone else than @RobertoIDL still have that problem? |
another observation: AS doesn't show the dependency sometimes, but that doesn't necessarily mean it's not there :). so try a clean build from command line and run the dependencies command to see if it's really not present. |
This happening because |
yup that makes sense. though previously (without the clean build command line dance) it was not available in the exploded-aar folder either (cause the class LeakCanary was not found at all). |
@kaushikgopal did you do gradle sync after you changed your gradle file? (Tools -> Android -> Sync project with Gradle Files) |
yup i do remember doing that as well. usually AS is pretty annoying about Kaushik On Thu, May 14, 2015 at 3:28 PM, Vladimir Baryshnikov <
|
Hi all, I got it working, not how I wanted but at least is working now. Let me explain the differences between my project and probably how everyone else is doing it. I have my app module and then another module called libraries where I have all the libraries that are not gradle compatible or that I have developed for this particular project. So my gradle settings file looks like this (I've changed some names): include ':app' I was trying to add the LeakCanary library to my baseAndroidLibrary and no matter what I try it doesn't work, I never get all the dependencies downloaded. If instead I add the library to my app's gradle file after a simple clean project everything is there. For the moment I will leave it as part of the app module as it's working but ideally I would like to have as part of my baseAndroidLibrary. Thank you all for your help. |
Alright. All problems fixed then. Looks like https://github.com/square/leakcanary#troubleshooting is all that's needed. |
New 512x512 icon (Issue square#9)
Hi all, |
If you have custom built type, add this too: |
i just change this the import : com.squareup.leakcanary.LeakCanary(cannot symbol class) to com.squareup.leakcanary.*; |
I have a project with lots of dependencies.
When I add
to main build.gradle, leakcanary-android is not in list of external libraries after gradle sync, although leakcanary-analyzer and leakcanary-watcher are there.
See screenshot:
On a blank project however everything works fine:
The text was updated successfully, but these errors were encountered: