2016-12-12 16 views
0

私のアンドロイドアプリケーションでは、チャートを作成する必要があるので、私はそのためにMPAndroidChartsを使いたいと思っています。私はv3.0.1の最新リリースを見ましたが、正しく。私はgradle設定を使用すると、私は以下のエラーが発生します。設定する方法MPAndroidChart:v3.0.1 in gradle

 Error:Gradle: A problem occurred configuring project ':app'. 
    > Could not resolve all dependencies for configuration ':app:_debugCompile'. 
    > Could not find com.github.PhilJay:MPAndroidChart:v3.0.1. 
     Searched in the following locations: 
      https://jcenter.bintray.com/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.pom 
      https://jcenter.bintray.com/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.jar 
      file:/usr/local/lib/android-sdk-linux/extras/android/m2repository/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.pom 
      file:/usr/local/lib/android-sdk-linux/extras/android/m2repository/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.jar 
      file:/usr/local/lib/android-sdk-linux/extras/google/m2repository/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.pom 
      file:/usr/local/lib/android-sdk-linux/extras/google/m2repository/com/github/PhilJay/MPAndroidChart/v3.0.1/MPAndroidChart-v3.0.1.jar 

私は間違っていますか?以下は私のgradle構成です。

 apply plugin: 'com.android.application' 

    android { 
     compileSdkVersion 23 
     buildToolsVersion '23.0.2' 
     useLibrary 'org.apache.http.legacy' 

     defaultConfig { 
      applicationId "com.example.myproject" 
      minSdkVersion 15 
      targetSdkVersion 23 
      versionCode 1 
      versionName "1.0" 
      vectorDrawables.useSupportLibrary = true 
     } 

     compileOptions { 
      sourceCompatibility JavaVersion.VERSION_1_6 
      targetCompatibility JavaVersion.VERSION_1_6 
     } 
     buildTypes { 
      release { 
       minifyEnabled false 
       proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      } 
     } 
     packagingOptions { 
      exclude 'META-INF/DEPENDENCIES.txt' 
      exclude 'META-INF/LICENSE.txt' 
      exclude 'META-INF/NOTICE.txt' 
      exclude 'META-INF/NOTICE' 
      exclude 'META-INF/LICENSE' 
      exclude 'META-INF/DEPENDENCIES' 
      exclude 'META-INF/notice.txt' 
      exclude 'META-INF/license.txt' 
      exclude 'META-INF/dependencies.txt' 
      exclude 'META-INF/LGPL2.1' 
     } 
    } 

    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     compile 'com.android.support:design:23.2.0' 
     compile 'com.android.support:cardview-v7:23.2.0' 
     compile 'com.android.support:recyclerview-v7:23.2.0' 
     compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE' 
     compile('org.springframework.android:spring-android-auth:1.0.1.RELEASE') { 
      exclude module: 'spring-core' 
     } 
     compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE' 
     compile 'org.apache.commons:commons-io:1.3.2' 
     compile 'com.github.PhilJay:MPAndroidChart:v3.0.1' 
    } 
+1

おそらく、GradleのはLIBを探すことができリポジトリ不足している: 'allprojectsを{ リポジトリ{ maven {url "https://jitpack.io"} } –

+0

@RomanKolomenskiiオフラインアプリを作成する予定です。インターネットにアクセスできない場合、これは問題ありますか? – KJEjava48

+1

いいえ、プロジェクトを同期するときに一度だけダウンロードします(jarファイル)。 –

答えて

1

あなたのbuild.gradle(プロジェクト:...):でそれを追加するのを忘れ

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

android {}内か外か – KJEjava48

+0

他のbuild.gradleには、プロジェクトのものとアプリのものがあります。 'allprojects'のある部分はすでにそこにあるはずです –

関連する問題