We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Unit tests ran with RobolectricTestRunner fail with the following exception:
RobolectricTestRunner
java.lang.NullPointerException at com.squareup.leakcanary.internal.LeakCanaryInternals.isInServiceProcess(LeakCanaryInternals.java:114) at com.squareup.leakcanary.LeakCanary.isInAnalyzerProcess(LeakCanary.java:182) at com.squareup.cash.CashApp.onCreate(CashApp.java:45) ...
The stack trace points to the following code in LeakCanary codebase:
ComponentName component = new ComponentName(context, serviceClass); ServiceInfo serviceInfo; try { serviceInfo = packageManager.getServiceInfo(component, 0); } catch (PackageManager.NameNotFoundException ignored) { // Service is disabled. return false; } // this line causes the crash if (serviceInfo.processName.equals(mainProcess)) {
Debugging shows that the value of processName is null.
processName
Robolectric: 4.0.1 Android: compileSdk = 28, targetSdk = 28, minSdk = 21
The text was updated successfully, but these errors were encountered:
Happy to provide more info or create a project that reproduces the issue if needed.
Sorry, something went wrong.
Set ServiceInfo.processName from ApplicationInfo.processName.
a7a1d10
Fixes #4090.
f71e385
Successfully merging a pull request may close this issue.
Description
Unit tests ran with
RobolectricTestRunner
fail with the following exception:The stack trace points to the following code in LeakCanary codebase:
Debugging shows that the value of
processName
is null.Robolectric & Android Version
Robolectric: 4.0.1
Android: compileSdk = 28, targetSdk = 28, minSdk = 21
The text was updated successfully, but these errors were encountered: