Closed bigsquirrel closed 6 years ago
Hi!
Provide ajc-compile.log and ajc-transform.log files, which located in app/build
directory to analyze this error. Also your build.gradle file would be helpful too.
Also please look on demo projects: https://github.com/Archinamon/AndroidAspectJExample https://github.com/Archinamon/AndroidAspectJExample2
There has no log files in app/build directory. The gradle console has message "Ajc classpath doesn't has needed runtime environment". My build.gradle file is the same like the demo.
It seems like the plugin doesn't support java8. I'm using the java annotation style not .aj code.
This error notifies that Aj runtime not applied correctly. Do not think tge problem is in java 8, cause it simply does not allow to write aspect classes with java 8 syntax. Will look deep this case.
thks
gradle version: 3.0.1 java version:1.8 as:3.0
FATAL EXCEPTION: main Process: com.demo.ivanchou.aspectjdemo, PID: 18376 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.demo.ivanchou.aspectjdemo/com.demo.ivanchou.aspectjdemo.LoginActivity}: java.lang.ClassNotFoundException: Didn't find class "com.demo.ivanchou.aspectjdemo.LoginActivity" on path: DexPathList[[zip file "/data/app/com.demo.ivanchou.aspectjdemo-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2250) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.demo.ivanchou.aspectjdemo.LoginActivity" on path: DexPathList[[zip file "/data/app/com.demo.ivanchou.aspectjdemo-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469) at android.app.Instrumentation.newActivity(Instrumentation.java:1089) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2413) at android.app.ActivityThread.access$800(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1317) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Suppressed: java.lang.ClassNotFoundException: com.demo.ivanchou.aspectjdemo.LoginActivity at java.lang.Class.classForName(Native Method) at java.lang.BootClassLoader.findClass(ClassLoader.java:781) at java.lang.BootClassLoader.loadClass(ClassLoader.java:841) at java.lang.ClassLoader.loadClass(ClassLoader.java:504) ... 13 more Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available