MPAndroidChart LineChart 绘制折线图图表时遇到的一个错误:
https://github.com/PhilJay/MPAndroidChart
https://github.com/alidili/Demos/tree/master/MPAndroidChartDemo
贡献出build.gradle
android {
compileSdkVersion 28
defaultConfig {
multiDexEnabled true
applicationId "com.example.m1571.mycolorfulnews"
// minSdkVersion 16
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// 使用support.v8.renderscript
renderscriptTargetApi 18
renderscriptSupportModeEnabled true
multiDexEnabled true
}
dexOptions {
// incremental true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta2'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta2'
annotationProcessor 'com.google.dagger:dagger-compiler:2.2'
//指定注解处理器
//dagger公用api
compileOnly 'org.glassfish:javax.annotation:10.0-b28'
//添加android缺失的部分javax注解
// Because RxAndroid releases are few and far between, it is recommended you also
// explicitly depend on RxJava's latest version for bug fixes and new features.
// implementation 'com.android.support:design:23.4.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.jakewharton:butterknife:8.0.1'
implementation 'com.android.support:support-v4:24.2.1'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.dagger:dagger:2.2'
implementation 'io.reactivex:rxandroid:1.2.0'
implementation 'io.reactivex:rxjava:1.1.5'
implementation 'com.google.code.gson:gson:2.4'
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.squareup.retrofit2:converter-jackson:2.0.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.0.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.0.1'
implementation 'com.squareup.okio:okio:1.6.0'
implementation 'com.github.zhaokaiqiang.klog:library:1.4.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'de.greenrobot:greendao:1.3.7'
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
implementation 'com.dmitrymalkovich.android:material-design-dimens:1.2'
implementation 'com.jakewharton.rxbinding:rxbinding-recyclerview-v7:0.4.0'
implementation 'com.github.chrisbanes:PhotoView:1.2.6'
implementation 'com.nineoldandroids:library:2.4.0'
//AndroidViewAnimations 动画
implementation 'com.daimajia.easing:library:1.0.1@aar'
implementation 'com.daimajia.androidanimations:library:1.1.3@aar'
implementation 'com.squareup.picasso:picasso:2.5.2'
//SpringAnimation弹簧动画 minSdkVersion 16
// implementation 'com.android.support:support-dynamic-animation:25.3.0'
implementation 'com.facebook.rebound:rebound:0.3.8'
implementation 'com.android.support:gridlayout-v7:26.1.0'
//高斯模糊-毛玻璃
implementation ('com.ms-square:etsyblur:0.2.1'){
transitive = true;
}
implementation('com.github.ozodrukh:CircularReveal:2.0.1@aar') {
transitive = true;
}
//炫酷的菜单动画
implementation 'com.nightonke:boommenu:2.1.1'
//compile 'com.android.support:design:23.1.1'一起使用的动画布局效果
implementation 'com.github.clans:fab:1.6.4'
//快速实现3D标签云效果
implementation 'com.moxun:tagcloudlib:1.1.0'
//3D标签云
// implementation 'co.lujun:androidtagview:1.1.7'
// implementation 'androidx.appcompat:appcompat:1.0.1'
//VR全景图+Opengl3D模型展示
implementation 'com.github.sdfdzx:VRShow:v1.0.2'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
implementation 'com.google.vr:sdk-panowidget:1.101.0'
//播放器
implementation 'cn.jzvd:jiaozivideoplayer:6.2.12'
// //视频缓存
implementation 'com.danikula:videocache:2.7.1'
// // 导入腾讯云直播 SDK aar
implementation(name: 'LiteAVSDK_UGC_5.0.4978', ext: 'aar')
// //权限
// implementation 'pub.devrel:easypermissions:1.3.0'
// implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0-alpha-5'
// implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.35'
// implementation 'com.android.support:multidex:1.0.3'
/*圆形头像第三方库*/
implementation 'de.hdodenhof:circleimageview:2.2.0'
//第三方折线图,图表
// implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation project(':MPChartLib')
}
dexOptions {
// incremental true
}
注释掉上面代码即可。