androidannotations出现生成的类找不到

来源:互联网 发布:粉尘检测数据 编辑:程序博客网 时间:2024/06/05 09:06

使用androidannotations框架注解的Android出现全部注解生成类出现“错误: 找不到符号”提示。这个错误确实有点吓人,因为提示太含糊了。

错误: 找不到符号import net.unix8.program.user.UserDetailActivity_;

错误的原因,是我的代码中有这么一条注解

@ViewById    FloatingActionButton mAddButton;

然而在我的xml中的FloatingActionButton的id并不是mAddButton,因此改过来名字就行了。

<span style="font-size:12px;"><com.melnykov.fab.FloatingActionButton        android:id="@+id/mAddButton"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:layout_gravity="center|right"        android:layout_marginRight="16dp"        android:src="@drawable/ticket_buy"        fab:fab_colorNormal="@color/colorPrimary"        fab:fab_colorPressed="@color/colorPrimaryLight" /></span>

使用这个注解框架,如果出现找不到类的问题,先查找你的XML中的控件id与你使用注解找的控件id名称是否相同。清单文件中出现错误也会出现这个问题。

0 0