borsirc
borsirc

Reputation: 1

Gradle build failing in offline mode

I am new to android studio, when I enable Gradle offline mode it reports "sync failed No cached version of com.android.tools.build:gradle:4.1.1 available for offline mode." this have baffled me for a week wish someone could solve this for me

Upvotes: 0

Views: 1303

Answers (1)

David Kroukamp
David Kroukamp

Reputation: 36423

Basically your Gradle is offline so it won't attempt to consult the network to download any dependencies that aremt already in its cache.

  1. Please disable Gradle offline mode.

    Open the Preferences window by clicking FileSettings (on Mac, Android StudioPreferences).

    In the left pane, click Build, Execution, Deployment > Gradle.

    Check the Offline work checkbox.

    Click Apply or OK.

    OR

    If you're building from the command line, pass the --offline option.

  2. Rebuild the Project.

  3. Then re-enable Gradle offline mode again (if that's what you want).

Upvotes: 1

Related Questions