Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

432
Vistas
Can't use LeakCanary because of org.junit.Test class dependency in external libraries

I'm trying to use LeakCanary for finding memory leaks in my Android application. I'm using Android Studio.

When I start debugging my application I see "LeakCanary is currently disabled: test class org.junit.Test was found in classpath." message.

"org.junit.test" class came from external library.

How can I force enable LeakCanary?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

LeakCanary automatically disables itself in tests by detecting that the org.junit.Test is in the classpath. Unfortunately, some apps ship Junit in their app debug classpath (e.g. when using OkHttp MockWebServer). You can customize which class is used to detect tests:

<resources>
  <string name="leak_canary_test_class_name">assertk.Assert</string>
</resources>

The doc needs to be updated (tracked here: https://github.com/square/leakcanary/issues/1968)

over 4 years ago · Santiago Trujillo Denunciar

0

Sometimes it helps to check your module build.gradle file and find "implementation" instead of "testImplementation" or "androidTestImplementation" for test dependencies. It may cause this issue.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda