Archinamon / android-gradle-aspectj

gradle plug-in adding supports of AspectJ into Android project
Apache License 2.0
364 stars 58 forks source link

Getting classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath) when running instrumentation tests #29

Closed kirillzh closed 7 years ago

kirillzh commented 7 years ago

I'm getting this error when I run instrumentation tests using the plugin. Also happens in example project:

classpath error: unable to find org.aspectj.lang.JoinPoint (check that aspectjrt.jar is in your classpath)

Test:

package com.archinamon.example;

import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

// AspectJExampleAndroid/app/src/androidTest/java/com/archinamon/example/ApplicationTest.java
@RunWith(AndroidJUnit4.class)
public class ApplicationTest {

  @Rule
  public ActivityTestRule<MainActivity> mainActivityActivityTestRule = new ActivityTestRule<>(MainActivity.class);

  @Test
  public void emptyTest() {
    System.out.println("Dummy test");
  }
}
Archinamon commented 7 years ago

This happens in incremental compile as I can see. Temporary you can run instrument test with clean flag. I've pushed example test into demo project.

Archinamon commented 7 years ago

fixed in 2.3.0; aspectj transformation will be skipped if aspectjrt lib didn't found in classpath while building.

nilstk commented 4 years ago

I just had the same issue with the newest version and Android Studio 3.5.4 - cleaning the project every(!) time as suggested above helps temporary.

cee-dee commented 4 years ago

I have the same issue with Android Studio 4.0 -- gradle clean helps but leads to monstrous build times ;-)

A real solution were great!