I have different solutions since none of the above solution worked for me I don't know why (in macOS)
To disabled the offline mode since com.google.android.gms:play-services-base:17.1.0 No cached version available for offline mode
STEP: 1 Just make changes like
com.google.android.gms:play-services-base:17.1.1 in the gradle
STEP: 2 Which will pop Sync Now option
press Sync Now
STEP: 3 then in your build will appear (Disable offline mode and Sync)
Press Disabled offline mode and Sync and the offline mode will be disabled
STEP: 4 Change com.google.android.gms:play-services-base:17.1.1 to com.google.android.gms:play-services-base:17.1.0 then Sync again
It worked for me hope it helps you