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

Exception while calling LeakCanaryConfig.configure #2270

Closed
preetha1326 opened this issue Jan 5, 2022 · 0 comments · Fixed by #2273
Closed

Exception while calling LeakCanaryConfig.configure #2270

preetha1326 opened this issue Jan 5, 2022 · 0 comments · Fixed by #2273
Milestone

Comments

@preetha1326
Copy link
Collaborator

preetha1326 commented Jan 5, 2022

Description

Calling LeakCanaryConfig.configure is causing Caused by: java.lang.IllegalStateException: LeakCanary not installed, see AppWatcher.manualInstall()

LeakCanaryConfig.configure is called before calling manualInstall. The exception do not happen when LeakCanaryConfig.configure call is done after calling AppWatcher.manualInstall()

Version Information

  • LeakCanary version: 2.8
  • Android OS version: 10
  • Gradle version: 7.3.2

Additional Information

Stacktrace

java.lang.ExceptionInInitializerError
	at leakcanary.LeakCanary$Config.<init>(LeakCanary.kt:199)
	at leakcanary.LeakCanary.<clinit>(LeakCanary.kt:352)
	at leakcanary.LeakCanary.getConfig(LeakCanary.kt:352)
	at com.squareup.leakcanary.LeakCanaryConfig.configure(LeakCanaryConfig.kt:33)
	at com.squareup.leakcanary.ConfigLeaksOnAppStart.onEnterScope(ConfigLeaksOnAppStart.kt:11)
	at mortar.MortarScope.register(MortarScope.java:199)
	at com.squareup.RegisterAppDelegate.onEnterScope(RegisterAppDelegate.java:444)
	at com.squareup.development.RegisterDevAppDelegate.onEnterScope(RegisterDevAppDelegate.java:54)
	at com.squareup.instrumentation.framework.TestAppDelegate.onEnterScope(TestAppDelegate.java:358)
	at mortar.MortarScope.register(MortarScope.java:199)
	at com.squareup.RegisterAppDelegate.createAppScope(RegisterAppDelegate.java:335)
	at com.squareup.instrumentation.framework.TestAppDelegate.createTestAppScope(TestAppDelegate.java:332)
	at com.squareup.instrumentation.framework.TestAppDelegate.createAppScope(TestAppDelegate.java:320)
	at com.squareup.RegisterAppDelegate.onCreate(RegisterAppDelegate.java:189)
	at com.squareup.development.RegisterDevAppDelegate.onCreate(RegisterDevAppDelegate.java:46)
	at com.squareup.instrumentation.framework.TestAppDelegate.onCreate(TestAppDelegate.java:316)
	at com.squareup.CommonPosApp.onCreate(CommonPosApp.kt:39)
	at com.squareup.appointments.development.AposDevApp.onCreate(AposDevApp.java:13)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
	at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:428)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
	at android.app.ActivityThread.-wrap2(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:154)
	at android.app.ActivityThread.main(ActivityThread.java:6119)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.IllegalStateException: LeakCanary not installed, see AppWatcher.manualInstall()
	at leakcanary.internal.InternalLeakCanary.getApplication(InternalLeakCanary.kt:52)
	at leakcanary.ToastEventListener.<clinit>(ToastEventListener.kt:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants