我正在尝试在android studio中使用图形视图库来创建图形。我了解到我需要在构建中添加以下代码行。 app目录下的gradle文件
implementation 'com.jjoe64:graphview:4.2.2'
但是,当我在build.the gradle文件中添加上述代码时,我收到以下错误:
这是build.gradle文件:
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'
}
这是gradle-wrapper属性:
#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
我能做错什么?任何人都可以帮助我找到这个问题的解决方案或共享类似解决方案的链接。
我有同样的错误,我已经通过使用修复它
compile 'com.jjoe64:graphview:4.2.2'
代替
implementation 'com.jjoe64:graphview:4.2.2'
与SDK 26有相同的问题,而不是使用版本4.2.2。我正在使用implementation 'com.jjoe64:graphview:4.2.1'
有同样的问题Just DownGrade'com.jjoe64:graphview:4.2.1'