Skip to content
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

LeakCanary App is not installed #1064

Closed
vincent-paing opened this issue Jul 25, 2018 · 3 comments
Closed

LeakCanary App is not installed #1064

vincent-paing opened this issue Jul 25, 2018 · 3 comments

Comments

@vincent-paing
Copy link

vincent-paing commented Jul 25, 2018

I'm currently using LeakCanary 1.6 in my app. I followed the step and add the following in my app gradle file

debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.1'

And then in my app I have this following code

override fun onCreate() {
    super.onCreate()
    if (LeakCanary.isInAnalyzerProcess(this)) {
      // This process is dedicated to LeakCanary for heap analysis.
      // You should not init your app in this process.
      return
    }
    LeakCanary.install(this)

    if (BuildConfig.DEBUG) {
      Timber.plant(DebugTree())
    }
  }

However, after clean building and installing apk via "Run", it was not installed on the emulator. My emulator info is

Emulator Name : Nexus9_API_27
Emulator Version - 27.3.9-4899998
Android Version - 8.1 (Oreo) - API 27

I also tried with my physical device but it seem to be not installed in there too.

Device Name : Xiaomi A1
Android Version : 8.1.0 (July Update)

I couldn't find anything in the logcat that might be related to Logcat either.

EDIT: I found out that on 1.5.4, "Leaks" was installed on the device too, but on 1.6.1, was this feature removed? If that's the case, this issue can be closed

@vincent-paing vincent-paing changed the title LeakCanary is not installed emulator LeakCanary is not installed Jul 25, 2018
@vincent-paing vincent-paing changed the title LeakCanary is not installed LeakCanary App is not installed Jul 25, 2018
@pyricau
Copy link
Member

pyricau commented Jul 25, 2018

Hi @vincent-paing ! Just to clarify, when you say "LeakCanary is not installed", do you mean that the icon that starts the activity that displays the list of leaks is missing?

If yes: that's a slight change from before, we only enable it when we find the first leak. The idea was that until then, there's no reason to go see the list of leaks since it's empty. Maybe that was a bad assumption?

You can call LeakCanary.enableDisplayLeakActivity(context) on app startup to ensure the leakcanary icon is always showing.

@vincent-paing
Copy link
Author

Yes I meant that the icon is missing on my launcher. I was confused because it used to work back in 1.5.4. I guess we can close this issue now then

@BzCoder
Copy link

BzCoder commented Aug 28, 2018

thanks ,solve my problem!

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

No branches or pull requests

3 participants