Description
NewRelicAppStartUpMetrics.applicationOnCreateTime is always a large negative number equal to -(SystemClock.uptimeMillis() / 1000) at the time of Application.onCreate(). The value is completely uncorrelated with the actual duration of Application.onCreate().
Steps to Reproduce
- Use NewRelic Android agent 7.7.6 with AGP 9.1.1 (or 9.0.1).
- Build and install the app on a device.
- Cold-launch the app and observe the
App launch time NewRelicAppStartUpMetrics{...} log line.
- Note the device uptime via
SystemClock.uptimeMillis() at Application.onCreate() start.
Repeatable formula:
applicationOnCreateTime ≈ -(SystemClock.uptimeMillis_at_onCreate_start / 1000)
Expected Behavior
applicationOnCreateTime should be a small positive number representing the actual duration of Application.onCreate().
In our case, measured independently via ActivityLifecycleCallbacks:
Application.onCreate START | uptime=3254618ms
Application.onCreate END | uptime=3254637ms | duration=19ms
Expected: applicationOnCreateTime ≈ 0.019s
Actual: applicationOnCreateTime = -3254.35s
Relevant Logs / Console output
After fresh device reboot (~136s uptime):
D AppLaunchLifecycle: Application.onCreate START | uptime=136269ms
D AppLaunchLifecycle: Application.onCreate END | uptime=136309ms | duration=40ms
D newrelic: NewRelicAppStartUpMetrics{
contentProviderToAppStart=0.0,
applicationOnCreateTime=-135.628, <- should be ~0.040
appOnCreateEndToFirstActivityCreate=136.387,
firstActivityCreateToResume=1.679,
coldStartTime=2.305,
hotStartTime=90775.6,
warmStartTime=2.305
}
After ~57 minutes uptime:
D AppLaunchLifecycle: Application.onCreate START | uptime=3454454ms
D AppLaunchLifecycle: Application.onCreate END | uptime=3454471ms | duration=17ms
D newrelic: NewRelicAppStartUpMetrics{
contentProviderToAppStart=0.0,
applicationOnCreateTime=-3454.174, <- should be ~0.017
appOnCreateEndToFirstActivityCreate=3454.531,
firstActivityCreateToResume=1.148,
coldStartTime=1.505,
hotStartTime=3455.679,
warmStartTime=1.505
}
Your Environment
- NewRelic Android agent version:
7.7.6
- Android Gradle Plugin (AGP):
9.1.1 (also reproduced on 9.0.1)
- Gradle version:
9.5.1
- Kotlin:
2.3.21
- compileSdk / targetSdk:
36
- minSdk:
28
- Test device: Samsung Galaxy Z Fold 4 (SM-F936B), Android 16
Additional context
contentProviderToAppStart is always 0.0 - is this correct?
- Rebooting the device changes the magnitude of the negative value (confirming it tracks device uptime) but does not fix it.
Description
NewRelicAppStartUpMetrics.applicationOnCreateTimeis always a large negative number equal to-(SystemClock.uptimeMillis() / 1000)at the time ofApplication.onCreate(). The value is completely uncorrelated with the actual duration ofApplication.onCreate().Steps to Reproduce
App launch time NewRelicAppStartUpMetrics{...}log line.SystemClock.uptimeMillis()atApplication.onCreate()start.Repeatable formula:
Expected Behavior
applicationOnCreateTimeshould be a small positive number representing the actual duration ofApplication.onCreate().In our case, measured independently via
ActivityLifecycleCallbacks:Expected:
applicationOnCreateTime ≈ 0.019sActual:
applicationOnCreateTime = -3254.35sRelevant Logs / Console output
After fresh device reboot (~136s uptime):
After ~57 minutes uptime:
Your Environment
7.7.69.1.1(also reproduced on9.0.1)9.5.12.3.213628Additional context
contentProviderToAppStartis always0.0- is this correct?