I'm working on a mobile app project for work, but often when I attempt to run the application it gives me the following error: 

> 
> Error:A problem occurred configuring root project 'projectName'.
>  Could not resolve all dependencies for configuration ':classpath'.
>  Could not resolve com.android.tools.build:gradle:2.2.3.
>  Required by:
>  :projectName:unspecified
>  No cached version of com.android.tools.build:gradle:2.2.3 available for offline mode.
> 
> 
> 

I have tried a number of different things including deselecting the Offline work checkbox in the settings and then closing and re-opening Android Studio, but nothing seems to fix the issue. It may build fine for a few times in a row, but that same error keeps popping up. Then I have to try variations of building and making the app, or exiting and re-opening Android Studios. Nothing consistently works though. Any insight into what may be causing this issue and how it can be fixed would be appreciated. 

\*\*\*Update: Upon request I have added below my app gradle content

```
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'

dexOptions {
    javaMaxHeapSize "8g"
}

defaultConfig {
    applicationId "com.example"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"

    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug{ 
        debuggable true
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'

compile files('libs/gson-2.2.2.jar')
compile group: 'cz.msebera.android' , name: 'httpclient', version: '4.4.1.1'
compile 'com.facebook.stetho:stetho:1.3.1'
compile 'com.loopj.android:android-async-http:1.4.9'
}

```