Skip to content

Commit 136bf7f

Browse files
Merge pull request #2249 from android:forceenable
PiperOrigin-RevId: 647039328
2 parents 7cf2440 + 3e1d6df commit 136bf7f

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

runner/monitor/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
**Bug Fixes**
88

9+
* Catch and log NoSuchMethodError on forceEnableAppTracing calls
10+
911
**New Features**
1012

1113
**Breaking Changes**

runner/monitor/java/androidx/test/platform/tracing/AndroidXTracer.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ public AndroidXTracer enableTracing() {
5959
// The AndroidX call can fail if reflection is not allowed.
6060
// We want to log the error yet we should not break any test in this case.
6161
Log.e(TAG, "enableTracing failed", e);
62+
} catch (NoSuchMethodError e) {
63+
// This can occur if an androidx.tracing < 1.1.0 is put on classpath instead.
64+
// See http://issuetracker.google.com/349628366).
65+
// We want to log the error yet we should not break any test in this case.
66+
Log.e(
67+
TAG,
68+
"enableTracing failed. "
69+
+ "You may need to upgrade your androidx.tracing:tracing version",
70+
e);
6271
}
6372
return this;
6473
}

0 commit comments

Comments
 (0)