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

Update LeakCanary library #10085

Merged
merged 1 commit into from
Jul 12, 2023
Merged

Conversation

TacoTheDank
Copy link
Member

@TacoTheDank TacoTheDank commented May 11, 2023

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Update LeakCanary library 2.9.1 -> 2.12 (changelog)
  • Fix LeakCanary deprecations

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@AudricV AudricV added the codequality Improvements to the codebase to improve the code quality label May 12, 2023
@AudricV
Copy link
Member

AudricV commented May 18, 2023

Version 2.11 has been released yesterday and it fixes some bugs. Could you bump the version update to this version and try to see if everything still works fine?

@TacoTheDank
Copy link
Member Author

TacoTheDank commented May 22, 2023

Done. Things look fine.

@sonarcloud
Copy link

sonarcloud bot commented May 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Jul 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Comment on lines 291 to 292
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leakCanaryVersion}"
implementation "com.squareup.leakcanary:plumber-android:${leakCanaryVersion}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmh, why are these not debugImplementation?

@Stypox Stypox merged commit f8599d1 into TeamNewPipe:dev Jul 12, 2023
@TobiGr
Copy link
Member

TobiGr commented Jul 14, 2023

I get this crash when Android Studio tries to lauch the app after installing it. It's an endless loop. Debug builds cannot be run.

FATAL EXCEPTION: main
Process: org.schabi.newpipe.debug.bugfixfeedcrash, PID: 6951
java.lang.RuntimeException: Unable to create application org.schabi.newpipe.DebugApp: java.lang.IllegalStateException: AppWatcher already installed, see exception cause for prior install call
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7656)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.IllegalStateException: AppWatcher already installed, see exception cause for prior install call
	at leakcanary.AppWatcher.manualInstall(AppWatcher.kt:98)
	at leakcanary.AppWatcher.manualInstall$default(AppWatcher.kt:94)
	at org.schabi.newpipe.DebugApp.onCreate(DebugApp.kt:17)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
	at android.os.Handler.dispatchMessage(Handler.java:106) 
	at android.os.Looper.loop(Looper.java:223) 
	at android.app.ActivityThread.main(ActivityThread.java:7656) 
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
Caused by: java.lang.RuntimeException: manualInstall() first called here
	at leakcanary.AppWatcher.manualInstall(AppWatcher.kt:116)
	at leakcanary.AppWatcher.manualInstall$default(AppWatcher.kt:94)
	at leakcanary.internal.MainProcessAppWatcherInstaller.onCreate(MainProcessAppWatcherInstaller.kt:21)
	at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
	at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
	at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
	at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
	at android.os.Handler.dispatchMessage(Handler.java:106) 
	at android.os.Looper.loop(Looper.java:223) 
	at android.app.ActivityThread.main(ActivityThread.java:7656) 
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
2023-07-14 15:11:46.152  6951-6951  ACRA                    org...newpipe.debug.bugfixfeedcrash  E  ACRA caught a RuntimeException for org.schabi.newpipe.debug.bugfixfeedcrash
java.lang.RuntimeException: Unable to create application org.schabi.newpipe.DebugApp: java.lang.IllegalStateException: AppWatcher already installed, see exception cause for prior install call
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:223)
	at android.app.ActivityThread.main(ActivityThread.java:7656)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.IllegalStateException: AppWatcher already installed, see exception cause for prior install call
	at leakcanary.AppWatcher.manualInstall(AppWatcher.kt:98)
	at leakcanary.AppWatcher.manualInstall$default(AppWatcher.kt:94)
	at org.schabi.newpipe.DebugApp.onCreate(DebugApp.kt:17)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6712)
	at android.app.ActivityThread.access$1300(ActivityThread.java:237) 
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913) 
	at android.os.Handler.dispatchMessage(Handler.java:106) 
	at android.os.Looper.loop(Looper.java:223) 
	at android.app.ActivityThread.main(ActivityThread.java:7656) 
	at java.lang.reflect.Method.invoke(Native Method) 
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
Caused by: java.lang.RuntimeException: manualInstall() first called here
	at leakcanary.AppWatcher.manualInstall(AppWatcher.kt:116)
	at leakcanary.AppWatcher.manualInstall$default(AppWatcher.kt:94)
	at leakcanary.internal.MainProcessAppWatcherInstaller.onCreate(MainProcessAppWatcherInstaller.kt:21)
	at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
	at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
	at android.app.ActivityThread.installProvider(ActivityThread.java:7239)
	at android.app.ActivityThread.installContentProviders(ActivityThread.java:6780)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6697)

@TacoTheDank TacoTheDank deleted the bumpLeakCanary branch July 14, 2023 16:42
@TacoTheDank TacoTheDank mentioned this pull request Jul 14, 2023
5 tasks
@TacoTheDank
Copy link
Member Author

@TobiGr Fixed. I forgot to disable the auto-install. #10231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants