5

I am trying to add Robobinding with AspectJ using gradle to a new project in Android Studio. When I click "Sync Project with Gradle Files", the process has remained at "Gradle: Download https://jcenter.bintray.com/org/aspectj/aspectjtools/1.8.2/aspectjtools-1.8.2.jar" for the last 8 hours overnight. It did not timeout or throw some error.

I tried to manually download aspectjtools-1.8.2.jar and place in C:\Users\Knobloch.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjtools\1.8.2 but discovered from the nearby folders that they have some sort of GUID subfolder that I would need.

I have tried adding the jar manually in the libs folder and used:

compile files('libs/aspectjtools-1.8.2.jar')

which did not work. (And now I've noticed the gradle compile tree function in my module config would be redundant).

Here is relevant section of my Project build.gradle:

buildscript {
 repositories {
    jcenter()
    maven() {
        name 'RoboBinding AspectJPlugin Maven Repository'
        url "https://github.com/RoboBinding/RoboBinding-aspectj-plugin/raw/master/mavenRepo"
    }
 }
 dependencies {
    classpath 'org.robobinding:aspectj-plugin:0.8.4'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
 }
}
apply plugin: 'org.robobinding.android-aspectj'
apply plugin: 'com.neenbedankt.android-apt'

And relevant section in my Module:app build.gradle:

dependencies {
 compile fileTree(include: ['*.jar'], dir: 'libs')
 compile 'com.android.support:appcompat-v7:22.2.0'
 compile 'com.android.support:support-v4:22.2.0'
 compile "org.robobinding:robobinding:$robobindingVersion"
 aspectPath "org.robobinding:robobinding:$robobindingVersion"
 //alternatively we can use with-aop-and-dependencies jar(RoboBinding provides a minimal Proguarded with-aop-and-dependencies jar.).
 compile("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") {
    exclude group: 'com.google.guava', module: 'guava'
 }
 aspectPath("org.robobinding:robobinding:$robobindingVersion:with-aop-and-dependencies") {
    exclude group: 'com.google.guava', module: 'guava'
 }
 compile files('libs/aspectjtools-1.8.2.jar')
}
Akeshwar Jha
  • 4,516
  • 8
  • 52
  • 91
Peter
  • 155
  • 2
  • 9
  • why don't you just get aspect j tools via maven? if you are interested in doing it that way then I will provide that as an answer below. – Joel Dean Jul 05 '15 at 00:01

1 Answers1

1

Refer to answer given by @user "Andromeda" here.

If you are using Android Studio 0.8 or above, a more detailed answer is here by @user "SamRad".

Community
  • 1
  • 1
Adi Tiwari
  • 761
  • 1
  • 5
  • 17