ButterKnife在Travis

时间:2017-03-05 13:41:13

标签: android travis-ci

我有一个在我的系统上构建完美的项目,但是当Travis尝试构建它时,ButterKnife会抛出一个错误,即无法找到正在使用的库的符号。

我分叉Clans FloatingActionButton,然后通过Android Studio导入gradle模块将其包含在项目中。

当Travis尝试构建项目时,会抛出以下错误

/home/travis/build/tpb1908/AndroidProjectsClient/app/src/main/java/com/tpb/projects/project/ProjectActivity.java:81: Note: @BindView field with unresolved type (FloatingActionMenu) must elsewhere be generated as a View or interface. (com.tpb.projects.project.ProjectActivity.mMenu)

对于com.github.clans.fab包中的一个类,每次BindView调用都会发生这种情况。

如何解决此问题?

编辑视图在布局中声明为

<com.github.clans.fab.FloatingActionMenu
    android:id="@+id/project_fab_menu"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="16dp"
    app:menu_colorNormal="@color/colorAccent"
    app:menu_colorPressed="@color/colorAccent">

    <com.github.clans.fab.FloatingActionButton
        android:id="@+id/project_add_column"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_column"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        app:fab_label="@string/text_fab_new_column"
        app:fab_colorNormal="@color/colorAccent"
        app:fab_colorPressed="@color/colorAccent"/>

    <com.github.clans.fab.FloatingActionButton
        android:id="@+id/project_add_issue"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_issue"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        app:fab_label="@string/text_fab_new_issue"
        app:fab_progress_showBackground="false"

        app:fab_colorNormal="@color/colorAccent"
        app:fab_colorPressed="@color/colorAccent"/>

    <com.github.clans.fab.FloatingActionButton
        android:id="@+id/project_add_card"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_note"
        android:background="@null"
        android:layout_marginBottom="8dp"
        android:layout_marginEnd="8dp"
        android:visibility="gone"
        app:fab_label="@string/text_fab_new_card"
        app:fab_colorNormal="@color/colorAccent"
        app:fab_colorPressed="@color/colorAccent"/>

</com.github.clans.fab.FloatingActionMenu>

然后绑定为

@BindView(R.id.project_fab_menu) FloatingActionMenu mMenu;
@BindView(R.id.project_add_card) FloatingActionButton mAddCard;
@BindView(R.id.project_add_column) FloatingActionButton mAddColumn;
@BindView(R.id.project_add_issue) FloatingActionButton mAddIssue;

0 个答案:

没有答案