0

Just installed Android Studio for the first time on this new machine and was trying to import a project that used to work without any errors a year ago on another machine.

Had to fix plenty of errors by just downloading and installing updates (recommendations).

The one error that's left is in the title.

This is my build.gradle source:

apply plugin: 'com.android.application'

android {
compileSdkVersion 24


repositories {
    mavenCentral()
}
defaultConfig {
    applicationId "com.test.testaa"
    vectorDrawables.useSupportLibrary = true
    minSdkVersion 19
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
testCompile 'junit:junit:4.12'
}
Marina
  • 1
  • 3
  • Possible duplicate of [All com.android.support libraries must use the exact same version specification](https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification) – chrjs Nov 21 '17 at 13:38
  • post output for `gradlew app:dependencies --configuration releaseRuntimeClasspath`. I think your problem in `facebook-android-sdk:4.+` – DeKaNszn Nov 21 '17 at 13:40
  • @chrjs I did already :( – Marina Nov 21 '17 at 13:42
  • @Marina isn't the log showing the library, whose versions are different? – Debanjan Nov 21 '17 at 13:44
  • @DeKaNszn ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk1.8.0_ 25 – Marina Nov 21 '17 at 13:46
  • @Marina if you get this error, than you can't build app. You should fix it before solving this question – DeKaNszn Nov 21 '17 at 13:54
  • @DeKaNszn Managed to fix that on. The initial error still there though. Im getting the library now. It's the same versions: https://pastebin.com/raw/r5hcZzFk Removing the play-service implementations fixed it for some reason. Thx – Marina Nov 21 '17 at 15:19

0 Answers0