2017-03-16 12 views
0

私はMPAndroidChartを使用して、アンドロイドアプリケーションでグラフをプロットしています。私はレーダープロット、円グラフ、折れ線グラフをしています。私の問題は、レーダープロットがこのライブラリの別のバージョンを必要とすることです。これは他の2つのプロットでは機能しません。Androidスタジオbuild.gradleコンパイルエラー

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:24.2.0' 
compile 'com.android.support:support-v4:24.2.0' 

compile 'com.github.PhilJay:MPAndroidChart:v3.0.1' 

compile 'com.github.PhilJay:MPAndroidChart:v2.1.6' 


} 

私の依存関係からわかるように、私は2つの異なるバージョンをコンパイルします。これによりエラーが発生し、そのうちの1つだけしか動作しないため、レーダープロットが機能しないか、他の2つが機能しません。

私は同じライブラリの2つのバージョンをどのようにコンパイルできますか?同じライブラリの複数のバージョンをダウンロードするには

答えて

0

repositories { 
    mavenCentral() 
} 

configurations { 
    compile5 
    compile6 
} 

dependencies { 
    compile5 'org.osgi:org.osgi.core:5.0.0' 
    compile6 'org.osgi:org.osgi.core:6.0.0' 
} 

task libs(type: Sync) { 
    from configurations.compile5 
    from configurations.compile6 
    into "$buildDir/libs" 
} 

をあなたは How to get Multiple Versions of the same library

0

を確認することができますmajor changesは2.x.x.対V3.0.0でMPChartsでした

最新のライブラリを使用して、適切に動作しない2つのチャートを調整する方がよいと思います。

関連する問題