Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

429
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda