Comments (19)
Hi, thanks for the report.
What device and what Android API version?
from leakcanary.
Xiaomi 4, Android 4.4.4. I was wondering if it is my problem with the project settings. I configured main, main2, main3 to be library project, and main4 depends on them. It's strange that LeakCanary is found while DisplayLeakActivity class in the internal package is not found.
from leakcanary.
it's probably because you are depending on the no-op dependency, which has a few of the classes but not all (it's for prod, so it's lightweight)
from leakcanary.
No. After I commented the no-op project's class, the problem still reproduce. The crash is in this line:
LeakCanaryInternals class's setEnabled method: packageManager.setComponentEnabledSetting(component, newState, DONT_KILL_APP);
from leakcanary.
Yep. Sorry, I was tired. Your classpath seems just fine. However, it looks like it can't find the activity in the manifest.
Can you look at the merged final AndroidManifest.xml and see if DisplayLeakActivity is declared in there? We declare it in the library (disabled), so it should automatically be merged in your debug app.
from leakcanary.
Ping.
from leakcanary.
Sorry, I didn't find the "merged final AndroidManifest.xml". Here is my project settings http://pic.yupoo.com/sinaweibo3482288945_v/EEmvaQWc/5JVmO.png
ps. I imported all project with Android Studio's new feature: import from version control -> github.
from leakcanary.
Why don't try doing a normal git checkout of the repo, and then File > New > Import Project
?
from leakcanary.
OK, I'll try.
from leakcanary.
Hi, I have the same issue while integrating the library in my app.
Samsung s3 4.4.4
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 21
}
dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.3'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
}
im using com.android.tools.build:gradle:1.2.3
from leakcanary.
@fistuk Can you check the final merged AndroidManifest.xml
file in the APK and see if DisplayLeakActivity
is declared in there?
Also, can you try adding this to your app manifest:
<activity
android:theme="@style/__LeakCanary.Base"
android:name="com.squareup.leakcanary.internal.DisplayLeakActivity"
android:enabled="false"
android:label="@string/__leak_canary_display_activity_label"
android:icon="@drawable/__leak_canary_icon"
android:taskAffinity="com.squareup.leakcanary"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
from leakcanary.
The activity is not declared so i think there is a problem with manifest merging.
Adding the declaration manually fails as well:
Component class com.squareup.leakcanary.DisplayLeakService does not exist in ----------------------
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4469)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5139)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Component class com.squareup.leakcanary.DisplayLeakService does not exist in ----------------------
at android.os.Parcel.readException(Parcel.java:1469)
at android.os.Parcel.readException(Parcel.java:1419)
at android.content.pm.IPackageManager$Stub$Proxy.setComponentEnabledSetting(IPackageManager.java:2984)
at android.app.ApplicationPackageManager.setComponentEnabledSetting(ApplicationPackageManager.java:1326)
at com.squareup.leakcanary.LeakCanary.setEnabled(LeakCanary.java:195)
at com.squareup.leakcanary.ServiceHeapDumpListener.(ServiceHeapDumpListener.java:30)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:56)
at com.squareup.leakcanary.LeakCanary.install(LeakCanary.java:43)
at ------------------.onCreate(Autocad360Application.java:37)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4466)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5139)
at java.lang.reflect.Method.invokeNative(Native Method)
from leakcanary.
What if you add everything that's defined here:
from leakcanary.
Eventually i've noticed that we are overriding the merged manifest to take the app's one (tools:node="replace"). So everything is working great. Thanks for the help.
from leakcanary.
This is just for others who have the same problem.
I have (tools:node="replace") defined, adding everything from https://github.com/square/leakcanary/blob/master/library/leakcanary-android/src/main/AndroidManifest.xml would work
from leakcanary.
I still have this problem. @pyricau Your link to https://github.com/square/leakcanary/blob/master/library/leakcanary-android/src/main/AndroidManifest.xml is broken. Could you please repaste it?
from leakcanary.
https://github.com/square/leakcanary/blob/master/leakcanary-android/src/main/AndroidManifest.xml
from leakcanary.
I still don't understand what the fix for this is. I am getting the error :
DisplayLeakActivity} does not exist.
The question was asked here :
http://stackoverflow.com/questions/37909067/displayleakactivity-does-not-exist
from leakcanary.
Import the source code of LeakCanary to your project, don't use dependency.If it doesn't work, reboot your machine.
from leakcanary.
Related Issues (20)
- Doc issue with fundamentals-how-leakcanary-works/ page
- Is it correct to mark fragment leaks when mFragmentManager is null? HOT 2
- [Library Leak] Navigation component 2.7.1 HOT 3
- IllegalArgumentException: Object id {id} not found in heap dump. HOT 2
- Android 14 One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED HOT 4
- Leak Canary Crash HOT 2
- Add `AwContents.f` to known library leaks HOT 7
- Couldn't open dumped heap - due to missing read/write permissions HOT 1
- shark-cli not working HOT 2
- Documentation - Link to AndroidReferenceMatchers path in github is outdated
- This is a strange question HOT 1
- v2.12 tag accidentally on wrong branch? HOT 1
- leakcary of this HOT 4
- Memory leak detected in ViewDataBinding.sReferenceQueue HOT 3
- targetSdkVersion 34 cause missingForegroundServiceTypeException HOT 1
- InputMethodManager.mImeInsetsConsumer leaking in API 30
- ANR in com.xxx.xxx:leakcanary HOT 1
- Memory leak in HeapAnalyzerService HOT 1
- AndroidObjectInspectors should read FragmentManagerImpl.mDestroyed to surface FragmentManagerImpl reachability
- Add imports to examples in docs HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leakcanary.