2

following the readme file on github:

I've added scribe to the dependency:

dependencies {
    classpath 'com.android.tools.build:gradle:0.4'
    classpath 'org.scribe:scribe:1.3.5'
}

The gradle build completes without errors but still i get errors:

Gradle: cannot find symbol class ServiceBuilder
Gradle: cannot find symbol class LinkedInApi
Gradle: cannot find symbol variable mRequestToken 
....

here is my build.gradle:

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.4'
}
}

apply plugin: 'android'

repositories {
maven {
    credentials {
        id 'scribe-java-mvn-repo'
    }
    url "https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/"
}
}

dependencies {
compile files('libs/android-support-v4.jar')
compile 'org.scribe:scribe:1.3.5'
} 
JY2k
  • 2,879
  • 1
  • 31
  • 60

1 Answers1

2

Create a new dependencies clause outside of the buildscript clause that looks like:

dependencies {
    compile 'org.scribe:scribe:1.3.5'
}

This is the dependencies clause for your code used by the java plugin.

Also make sure you have the repositories clause outside of the buildscript:

repositories {
   mavenCentral()
}

This is defines the repositories that will be searched for dependencies.

Remove the classpath 'org.scribe:scribe:1.3.5' from your buildscript dependencies clause. This clause is used for the buildscript itself.

Your new build.gradle file should look like:

buildscript {
   repositories {
      mavenCentral()
   }
   dependencies {
      classpath 'com.android.tools.build:gradle:0.4'
   }
}

apply plugin: 'android'

repositories {
   mavenCentral()
}

dependencies {
   compile files('libs/android-support-v4.jar')
   compile 'org.scribe:scribe:1.3.5'
} 
ditkin
  • 6,774
  • 1
  • 35
  • 37
  • Still not working. I imagine i have to add his personal repository also outside of the buildscript which i did. only im not sure how to add the id field as is shown in the github link. – JY2k Feb 17 '14 at 16:00
  • Can you post your entire build.gradle file. – ditkin Feb 17 '14 at 16:00
  • Do you have a "repositories { mavenCentral() }" clause at the top level (the same level as the dependencies clause that you just added? – ditkin Feb 17 '14 at 16:12
  • same error still, shouldnt i be referencing his private repo ? – JY2k Feb 17 '14 at 16:33
  • I'm still getting same error: Gradle: Execution failed for task ':VENN:compileDebug'. > Compilation failed; see the compiler error output for details. – JY2k Feb 17 '14 at 16:33
  • something new just poped. I am able to import org.scribe.*; but then i get: "Gradle: package org.scribe does not exist" – JY2k Feb 17 '14 at 16:37
  • Are you building from the command line or from within an IDE? – ditkin Feb 17 '14 at 16:47
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/47681/discussion-between-jy2k-and-ditkin) – JY2k Feb 17 '14 at 16:48