2016-08-02 2 views
1

MPAndroidChart에 대한 자습서를 작성하고 있었는데 에뮬레이터에서 잘 작동했습니다. 나는 APK를 빌드 할 때, 나는 내 build.gradle 스크립트 두 가지 오류를 ...APA 빌드 중 MPAndroidChart Android Studio 오류

"Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/github/mikephil/charting/BuildConfig;"

"Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_91\bin\java.exe'' finished with non-zero exit value 2"

누군가가 나를 도울 수 ...있다 있어

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "24.0.1" 

    defaultConfig { 
     applicationId "com.example.myname.lesson03" 
     minSdkVersion 7 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile ('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

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

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:24.1.0' 
    compile 'com.github.PhilJay:MPAndroidChart:v2.2.4' 

    testCompile 'junit:junit:4.12' 
} 

답변

1

아마도 build.gradle의 종속물에 동일한 라이브러리/디렉토리가 두 번 이상 포함되어있을 수 있습니다.

내 제안은 'libs'폴더를 확인하는 것입니다. 한 번만 MPAndroidChart를 참조하십시오.

또한,이 라인을 주석 처리하려고 : 이 fileTree 컴파일 (: [ '*의 .jar'] 디렉토리 : 포함 'libs와')

+0

깨끗한 프로젝트를하고 제안 주석으로 그 라인을/제거합니다. . 그리고 그 일하는 것. .. 감사하는 남자. –