Subclasses are not being generated for EpoxyModelClass (picture included below). The EpoxyModelClass is also missing the layout property to be overwritten within our models (@EpoxyModelClass(layout = R.layout.model_button) gives "cannot resolve method layout" error). This is our EpoxyModelClass.java:

And this is yours:

Generated subclasses are not recognized in SampleAdapter.java.

Yeah, that annotation update is only available starting in the 1.6.1 release https://github.com/airbnb/epoxy/pull/112 which I am about to push.
Sorry for the confusion.
I'm still doing a last minute check for any issues in 1.6.1 but will hopefully merge the release in the next hour. It's already on maven if you want to start using it though
Ran into a snag with multi module projects (see https://github.com/airbnb/epoxy/pull/112 for details). I'll leave this open until the release is properly out in case anybody else is confused by this.
Sorry!
Release is pushed :) https://github.com/airbnb/epoxy/releases
Let me know if you have any problems getting this to work now. I added a note to the readme that the @EpoxyModelClass(layout = R.layout.model_button) shortcut won't work in library projects for now, but hopefully you don't need that!
It works just fine now. Thanks! :)
I am using v2.0.0 and my models are not generating. I have the sample working but cannot figure out for the life of my why I cant get them generating in my project. I have my abstract models with class annotations and I am including the annotation processor in my build file. Any ideas what I could be doing wrong? Should I create a new issue for this?
Ahh... just noticed I'm getting the following warning:
Warning:Using incompatible plugins for the annotation processing: android-apt. This may result in an unexpected behavior.
Think this may have something to do with it.
that would do it, make sure you're using either apt or the new annotationProcessor. Also try cleaning before building.
If it still doesn't work, feel free to paste your model file and build.gradle so I can sanity check them, and see if there are any other compiler warnings.
Yeah, my project is using apt and I had copied the dependency declaration from the docs which is using annotationProcessor. Whoops, sorry about that. Thanks for the quick response.
馃憤 Seems like an easy mistake to make - thanks for posting your solution here so others can benefit :)
Mine is not generating, I've tried alot and still nothing. Using the EpoxyModelView annotation, but still not working. Using annotationProcessor and my projecr supports kotlin, still not working
@juicycleff if you are using kotlin you need to use kapt instead of annotationProcessor
Thanks yeah figured it out. Started using kapt
@elihart I'm also running into the issue of my model subclasses not being generated . I've made sure Annotation Processing is enabled in Android Studio for my project, and i'm using annotationProcessor in my build.gradle dependencies. I'm using epoxy v3.0.0-rc1. Mind taking a look at my attached View class and gradle file and telling me if i'm missing something?
TextCardView.java
package com.roarforgood.roar.epoxy;
import android.content.Context;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.airbnb.epoxy.ModelView;
import com.airbnb.epoxy.TextProp;
import com.roarforgood.roar.R;
@ModelView (defaultLayout = R.layout.view_holder_text_card)
public class TextCardView extends LinearLayout {
TextView titleView, bodyView;
public TextCardView(Context context) {
super(context);
titleView = findViewById(R.id.cardTitle);
bodyView = findViewById(R.id.cardBody);
}
@TextProp
public void setTitle(String text){
titleView.setText(text);
}
@TextProp
public void setBody(String text){
bodyView.setText(text);
}
}
build.gradle
plugins {
id 'com.gladed.androidgitversion' version '0.4.3'
}
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
}
}
compileSdkVersion 28
buildToolsVersion '28.0.3'
lintOptions {
checkReleaseBuilds true
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError true
}
defaultConfig {
...
}
buildTypes {
debug {
}
release {
}
}
flavorDimensions "distributionType"
productFlavors {
...
}
compileOptions {
incremental true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize '5120m'
}
dataBinding {
enabled = true
}
}
repositories {
maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-Android/master/" }
maven { url "https://maven.google.com" }
}
dependencies {
...
implementation 'com.airbnb.android:epoxy:3.0.0-rc1'
annotationProcessor 'com.airbnb.android:epoxy-processor:3.0.0-rc1'
...
}
apply plugin: 'com.google.gms.google-services'
@CodyEddings I don't see any issues with your files. I'd recommend trying the final 3.0.0. version that is now out, and making sure to clean and then rebuild
No luck unfortunately. Changing my dependencies to
implementation 'com.airbnb.android:epoxy:3.0.0'
annotationProcessor 'com.airbnb.android:epoxy-processor:3.0.0'
didn't fix the issue, even after after invalidating caches & restarting Android Studio, cleaning, and rebuilding.
Most helpful comment
@juicycleff if you are using kotlin you need to use
kaptinstead ofannotationProcessor