尝试使用HelloCharts时出错 - 意外的顶级异常

时间:2015-11-25 04:41:01

标签: android

我试图避免提出这个问题,因为在这个网站上已经多次询问过。我已尝试使用HelloCharts成功运行我的应用程序的所有方法,但已失败太多次。我已经移动了依赖关系以及存储库,希望它能解决它,但没有运气。

每次尝试运行我的应用时,我都会收到顶级异常。下面是我的build.gradle(app)。请提前感谢您的帮助。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "REMOVED FOR THIS POST"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
    compile 'com.github.lecho:hellocharts-android:v1.5.8'
}

以下是github的说明:

Android Studio / Gradle

Maven Central / jCenter,为build.gradle添加依赖项:

  dependencies{
      compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
  }

JitPack.io,将jitpack.io存储库和依赖项添加到build.gradle:

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

  dependencies {
      compile 'com.github.lecho:hellocharts-android:v1.5.8'
  }

以下是我不断收到的错误:

UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: `com.android.ide.common.process.ProcessException:` org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 2

1 个答案:

答案 0 :(得分:1)

我明白了。我把两个“Maven Central / jCenter,添加依赖于你的build.gradle:”和“JitPack.io,添加jitpack.io repositiory和依赖到你的build.gradle:”代码段。我从build.gradle中删除了以下代码,它工作正常:

dependencies{
      compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
  }