0

I have a maven project with 2 modules. One one of the modules contain the annotation processor. When I try to import the project as a dependency for an android project , it won't run the annotation processor. The generated class files aren't found.

    implementation 'com.github.OmerUygurOzer.jet:jetcore:v1.0.9'
    annotationProcessor'com.github.OmerUygurOzer.jet:jetprocessor:v1.0.9'

I import the project like shown above from jitpack. The build on jitpack succeeded and I can access the code locally also, meaning the compilation succeeds. But the classes that are supposed to be generated , aren't. So either the processor isn't firing or I generated classes are somehow at the wrong location? The android project does use many other libraries with annotation processors such as Butterknife. So this seems to be happening only with this particular annotation processor.

This is the error I get:

java.lang.ClassNotFoundException: Didn't find class "JetEventIndex" on 

path: DexPathList[[directory "."],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
01-30 23:31:38.418 1469-1469/? W/System.err:     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
01-30 23:31:38.418 1469-1469/? W/System.err:     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-30 23:31:38.418 1469-1469/? W/System.err:     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
01-30 23:31:38.418 1469-1469/? W/System.err:     at com.jetcore.JetClassLoader.getConstructorForEventIndex(JetClassLoader.java:45)
01-30 23:31:38.418 1469-1469/? W/System.err:     at com.jetcore.JetClassLoader.createEventIndex(JetClassLoader.java:54)
01-30 23:31:38.418 1469-1469/? W/System.err:     at com.jetcore.JetDock.<init>(JetDock.java:21)

Edit:

I tried changing the packaging type of the modules to jar , still nothing. My annotation processor won't fire.

The project link is here in case any one wants to check the pom files : https://github.com/OmerUygurOzer/Jet

Gradle Version 4.1 Android Plugin 3.0.1

Omer Ozer
  • 455
  • 1
  • 8
  • 20

2 Answers2

0

It seems version 1.0.9 is not available. Git page has version 1.0.4. Please try with 1.0.4.

https://github.com/OmerUygurOzer/Jet

Gokul Nath KP
  • 15,485
  • 24
  • 88
  • 126
  • 1
    it's available. I manage that repo . It didn't work on previous version either. Each version increment is basically me trying to get it to work. – Omer Ozer Jan 31 '18 at 07:21
0

Try to do like this:

1.Add it in your root build.gradle at the end of repositories:

allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

2.Add the dependency

dependencies {
            compile 'com.github.OmerUygurOzer.jet:jet:v1.0.9'
    }
Jay Patel
  • 2,341
  • 2
  • 22
  • 43