1

Here is my Gradle build file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

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

My application compiled ok, but when I tried to run it, I got this error:

enter image description here

Any thoughts on what is going wrong here? My machine is set up for Java 6. When I tried to upgrade to Java 7 I got some errors so I had to revert to Java 6.

Genadinik
  • 18,153
  • 63
  • 185
  • 284

2 Answers2

1

That error is due to problem in compilation which usually related to duplicated libraries or too many methods and classes. I guess that you are including google play services in you gradle . Try to use specific sub library from here https://developers.google.com/android/guides/setup.

Helmi
  • 556
  • 2
  • 19
  • I got rid of android-support-v4.jar from my own lib files and it got rid of the error. Do you know if that might cause problems later? What does that library do? :) – Genadinik Dec 16 '15 at 16:06
0

This error

This error about for uses and give referance same classes.Look here

Community
  • 1
  • 1
Numan Turkeri
  • 526
  • 4
  • 18
  • That link said that getting rid of the annotations jar solves the issues, but I don't have that jar :) – Genadinik Dec 16 '15 at 15:49
  • Thats Look here "The problem is that android-support-annotations.jar used to be a separate library containing the android annotations, but for some reason these annotations are already included in recent versions of the android-support-v4.jar file." – Numan Turkeri Dec 16 '15 at 15:52