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
Unable to get provider leakcanary.internal.LeakCanaryFileProvider #1597
Comments
Hello! With the Also, can you please share the part of gradle script where you add dependency on Leakcanary? Just want to make sure it's been set up properly. |
This is my dependence |
Dependency looks correct. |
yes,I still have problems with this version 2.0-beta-2. I guess if I used Alibaba's hotfix.I have 2 Applications.This is my wrong log.SophixStubApplication is the application of hotfix.There is also a my own application.
|
me too |
I meet the same issue.
|
me too,i also use
in proguard and multidex-config still not work and in output.apk i can find the provider registered in AndroidManifest.xml. and no problem happened to other provider |
I have this problem too |
Please refrain from adding "me too" comments that don't provide any insights, and use 👍 reactions instead. Questions for those having the issue:
We should definitely add the provider to our proguard rules, same as the installer. Though I'm not sure if that's the root cause here. |
Note: I will delete "me too" comments as well as comments that aren't in English. |
i meet this problem too. this is my import code : i think reason of this problem may be Depend on the isolation. |
@zhuruyi2013 try using |
I don't see how |
I have simmilar error (Unable to get provider leakcanary.internal.AppWatcherInstaller: java.lang.ClassNotFoundException: Didn't find class "leakcanary.internal.AppWatcherInstaller) :
It is not reproduce stable. Only some users from thousand of users have this error. I use R8, and split apk.
My proguard rules include this:
|
Can you provide a project that we can use to reproduce this issue? Note that your proguard rules are not correct anymore (these are for leakcanary 1.0) but this should be ok because the new version has its proguard rules included. |
I can not provide the project, because it is my company production app. And I can not reproduce this issue. It happends only with little count of users . |
"It happends only with little count of users" => Are you using the object watcher in production? If you have no need for it you can set it as a debug dependency (which should be the default when you add leakcanary) and that way it won't ship in production. |
I use dependencies:
If I remove implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:2.0-beta-3" I get compilation error, because something should be imported for non debug build type |
Can you share the error message you get? LeakCanary is intended to be debug-only dependency; this might be the reason why you get the crashes. |
I have
and use It as
If I remove implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:2.0-beta-3" I get compilation error "ReferenceWatcher.kt: (14, 13): Unresolved reference: AppWatcher" Of course I can provide different ReferenceWatcher for each build types, but we have 10 build variant and it is not usefull to write this for each of them |
As an alternative you can use reflection to set these, by checking first that the class is available at the runtime. It's more boilerplate, but will work if you can't extract code to some |
|
I think I'm getting the same issue.
|
@devism this is a different issue. Do you have a sample project that reproduces it? If yes can you create a new issue? |
I do have a sample project that reproduces the issue. I will create a new issue. |
Summary of everything that's been reported in this issue:
Without a sample project to reproduce, it's hard to figure it out. This could be a multidex issue if the Provider class somehow doesn't end up in the main dex.
|
I solved this problem by use "debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-1'" |
@JackFung2015 There were several distinct problems described here, which one did you solve? Also you should update to 2.1 :) |
Using version 2.1 will cause the program to crash directly |
@JackFung2015 if it's a runtime crash of the app then you should have a stacktrace. Can you share that stacktrace? |
currently i am getting this error |
@gustavofc1997 please file a separate issue and provide the full stacktrace. |
I'm going to close this for now, and lock comments. If you can reproduce this with a sample project then please open a new issue and provide the sample project. |
Error message:
Dependency:
不集成的时候,都是可以运行的,一集成之后就跑不了。项目是使用了AndroidX的,语言是java
Edit with translation from Google translate:
The text was updated successfully, but these errors were encountered: