android studio ButterKnife Zelezny 使用報錯

一、 錯誤信息描述

使用插件生成的時候,一直報錯,無法彈出如下的頁面

具體的報錯信息如下:


2、問題排查

經過快一個小時的排查, 首先懷疑插件衝突, 卸載掉前幾天裝的插件, 無效, 然後又升級、卸載重裝IDE都不行。

後面突然發現在其他頁面是可以正常使用的,所以懷疑是xml文件的問題。 故仔細排查了一遍xml文件,特別是id。果然發現異常的地方

有一個textview的 id 使用了兩個下劃線 __ ,在刪除掉一個之後,插件就能正常使用了。

<TextView
            android:id="@+id/tv_get_cash_act__nurse_commission"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/common_margin_12"
            android:text="提現  >"
            android:textColor="@color/white"
            android:textSize="16sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

3、 解決方法和思考

解決方法: 刪除掉多餘的下劃線,只保留一個

思考: 使用插件的過程中,總是會遇到各種問題,儘量以最小損失的方式 一步一步排查, 卸載重裝IDE實在是太浪費時間了。

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章