w201
w201

Reputation: 2228

AndroidAnnotation stop recognize EFragment(R.layout...)

Can't understand whats happens but now have stable problem with compiling with AA.

/AddEditEventFragment.java:239: error: Something went wrong: Unexpected error in AndroidAnnotations 4.6.0!
    public void afterViews() {
                ^
....
 Caused by: java.lang.annotation.AnnotationTypeMismatchException: Incorrectly typed data found for annotation element public abstract int org.androidannotations.annotations.EFragment.value() (Found data of type R.layout)
    at com.sun.tools.javac.model.AnnotationProxyMaker$ValueVisitor$1AnnotationTypeMismatchExceptionProxy.generateException
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import com.amicuscreative.zola.R;
@EFragment(R.layout.fragment_event_details_edit)
public class AddEditEventFragment extends Fragment
        implements AdapterView.OnItemLongClickListener, AdapterView.OnItemClickListener, ReminderAddListener {
....
}

AA - 4.6.0 gradle plugin - 3.5.0 gradle - 5.4.1 Build tools - 28.0.3

Of course layout is present.

Upvotes: 0

Views: 232

Answers (1)

w201
w201

Reputation: 2228

The Problem was in google volley lib. I had in other file import ...volley.* and my_package.*, and R classes are conflicted.

When I change volley.* to couple of volley.class_names it compiled without problem... Also IDEA try to optimize imports and could at any moment switch volley.class_name to volley.* back but its less problem than was :)

Always check all warnings and error even if they are not about your particular problem.

Upvotes: 0

Related Questions