Android: Could not find org.aspectj:aspectjtools:1.9.7.M1

  • Updated

Reference Number: 1763

Summary: After cleaning Gradle (removing ~/.gradle folder), build fails with the following exception:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find org.aspectj:aspectjtools:1.9.7.M1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/aspectj/aspectjtools/1.9.7.M1/aspectjtools-1.9.7.M1.pom
- https://jcenter.bintray.com/org/aspectj/aspectjtools/1.9.7.M1/aspectjtools-1.9.7.M1.pom
- http://developer.huawei.com/repo/org/aspectj/aspectjtools/1.9.7.M1/aspectjtools-1.9.7.M1.pom
- https://repo.spring.io/milestone/org/aspectj/aspectjtools/1.9.7.M1/aspectjtools-1.9.7.M1.pom
- https://thunderhead.mycloudrepo.io/public/repositories/one-sdk-android/org/aspectj/aspectjtools/1.9.7.M1/aspectjtools-1.9.7.M1.pom

Required by:
project : > com.thunderhead.android:orchestration-plugin:5.0.1

This issue occurs because the spring repository has recently removed the artifact that we use in the SDK.

Workaround: (Recommended)

We have released a fix for this reported issue, in our Android v11.0.1 and Orchestration v6.0.1 release.
 
To use this new version simply update the dependency in your build.gradle file to this new version:

classpath 'com.thunderhead.android:orchestration-plugin:6.0.1'
implementation "com.thunderhead.android:one-sdk:11.0.1"

Alternative Workaround:

If you are unable to update to the Android v11.0.1 and Orchestration v6.0.1 versions, you can also apply the following workaround in the Android application:

In the top level build.gradle buildscript block, add the following: 

configurations {
    classpath {
        resolutionStrategy {
            force("org.aspectj:aspectjtools:1.9.7")
        }
    }
}

In the top level build.gradle buildscript block, add the following to the dependencies section:

classpath "org.aspectj:aspectjtools:1.9.7"

In the top level build.gradle buildscript block, replace jcenter() with mavenCentral() in the repositories section:

repositories {
    google()
    mavenCentral()  
    maven { url 'https://thunderhead.mycloudrepo.io/public/repositories/one-sdk-android' }
}


After all is said and done, here's an example of the entire buildscript block:

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://thunderhead.mycloudrepo.io/public/repositories/one-sdk-android' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.6.4'
        classpath 'com.thunderhead.android:orchestration-plugin:5.0.1'
        classpath "org.aspectj:aspectjtools:1.9.7"
runtimeOnly("org.aspectj:aspectjrt:1.9.7") } configurations { classpath { resolutionStrategy { force("org.aspectj:aspectjtools:1.9.7") } } } }

Status: Resolved

Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request