0
repositories {
    maven { url "https://jitpack.io" }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.2'
}

I am getting the Error:Connection timed out: connect in online mode whereas while changing the gradle setting to offline, I could not open the library.

Vladimir Markeev
  • 654
  • 10
  • 25
Sriram
  • 1
  • 4

2 Answers2

0

Perhaps, your internet connection is too slow. You can download this library from github and import in your project.

Here is github repository link: https://github.com/PhilJay/MPAndroidChart

Just click on download button then select download ZIP and after downloading, copy the folder MPChartLib and paste into your project root directory and compile with gradle.

In your settings.gradle, include ':app', ':MDChartLib' and build.gradle(Module:app), compile project(':MDChartLib')

Muhammad Saad
  • 713
  • 1
  • 9
  • 31
0

Please connect to "Internet" and make it sync again.

Shivam Oberoi
  • 1,447
  • 1
  • 9
  • 18