dirty2k9
dirty2k9

Reputation: 39

Error trying to use HelloCharts - Unexpected Top Level Exception

I tried to avoid asking this question since it has been asked numerous times on this site. I have tried every which way to successfully run my app with HelloCharts included but have failed too many times. I have moved the dependencies around as well as the repositories hoping it would fix it but no luck.

I am getting a top level exception every time I try to run my app. Below is my build.gradle (app).Thank you in advance for your help.

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'
}

Here are the instructions from github:

Android Studio/Gradle

Maven Central/jCenter, add dependency to your build.gradle:

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

JitPack.io, add jitpack.io repositiory and dependency to your build.gradle:

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

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

Here is the error I keep getting:

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

Upvotes: 1

Views: 2178

Answers (1)

dirty2k9
dirty2k9

Reputation: 39

I figured it out. I was putting both the "Maven Central/jCenter, add dependency to your build.gradle:" and "JitPack.io, add jitpack.io repositiory and dependency to your build.gradle:" pieces of code. I removed the below code from my build.gradle and it worked fine:

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

Upvotes: 2

Related Questions