2

I'm trying to use graph view library in the android studio to create a graph. I've learned that I need to add the following line of code into the build. gradle file under the app directory

implementation 'com.jjoe64:graphview:4.2.2'

But the moment I add the aforesaid code in build.the gradle file I get the following error:

enter image description here

Here is the build.gradle file:

apply plugin: 'com.android.application'

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "tutorial.trusols.graphview"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    testCompile 'junit:junit:4.12'
    implementation 'com.jjoe64:graphview:4.2.2'
}

And here is the gradle-wrapper properties:

#Tue Jul 10 12:59:00 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip

What could I be doing wrong? Can anyone help me in finding the solution to this problem or share a link to a similar solution.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
pamo
  • 111
  • 2
  • 13

3 Answers3

1

I had the same error and I have fixed it by using

compile 'com.jjoe64:graphview:4.2.2'

instead of

implementation 'com.jjoe64:graphview:4.2.2'
OlivierGrenoble
  • 3,803
  • 2
  • 18
  • 25
1

Had the same problem Just DownGrade 'com.jjoe64:graphview:4.2.1'

0

Had the same problem with SDK 26, instead of using version 4.2.2. I'm using implementation 'com.jjoe64:graphview:4.2.1'