1

I just updated to using Android Studio 3.0 Canary 2. Upon opening my project Android Studio suggested I update the gradle version to 3.0.0-alpha2. My goal is to use the "Enable advanced profiling" Run Configuration so I can run a realtime memory-analysis. However the instant my gradle version was updated, my project fails to build. I followed the update instructions here.

The only changes made were to my top-level build.gradle file and the gradle-wrapper.properties file.

My top-level build.gradle:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
        classpath 'com.github.Archinamon:GradleAspectJ-Android:2.3.0'
        classpath 'me.tatarka:gradle-retrolambda:3.5.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url 'https://repo.adobe.com/nexus/content/repositories/releases/' }
        maven { url 'http://maven.localytics.com/public' }
    }
}

And I updated the gradle-wrapper.properties distributionURL to:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip

The error I get is:

Failed to apply plugin [id'com.archinamon.aspectJ']

And here is the offending part of my app-level build.gradle file:

import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
apply plugin: 'com.archinamon.aspectj'
aspectj {
    includeAspectsFromJar 'Android_MTAgent'
}
android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
....
}

So the problem seems to be with the aspectJ plugin. If I remove the plugin for aspectJ and the related aspectJ block (both shown above) then it compiles (I get a dimen error then though, but I already saw that mentioned elsewhere, so I guess that can be solved.)

I'd appreciate any pointers/ideas in regard to the above issue.

AgentKnopf
  • 4,295
  • 7
  • 45
  • 81
  • This question is also answered in this post: https://stackoverflow.com/questions/44364630/unable-to-run-project-after-update-to-android-studio-preview-3-0-canary-3 – sgupta Jun 20 '17 at 20:53
  • @sgupta Looks like the question you linked is a duplicate and it doesn't talk at all about the really relevant part of this question: The AspectJ plugin – AgentKnopf Jun 22 '17 at 14:18

1 Answers1

2

Change your project build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
}

to

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
}

and update your Archinamon classpath reference in the same build.gradle file to:

classpath 'com.github.Archinamon:GradleAspectJ-Android:3.0.2'
AgentKnopf
  • 4,295
  • 7
  • 45
  • 81
  • Thank you for your suggestions. Unfortunately this does not fix the original error, however it adds another error: compleSdkVersion is not specified, which is not true, as I have it set: compileSdkVersion 25 – AgentKnopf Jun 03 '17 at 12:41
  • Try classpath 'com.github.Archinamon:GradleAspectJ-Android:3.0.2' – Ludy Astra-Germany Jun 03 '17 at 13:56
  • Ah good catch! This actually works! Now I'll just have to fix all the other errors that the Canary Release brings with it :) – AgentKnopf Jun 03 '17 at 14:39