iT邦幫忙

0

[Errors]上一次還能執行的專案,突然跳紅字

  • 分享至 

  • xImage
  •  

症狀:https://ithelp.ithome.com.tw/upload/images/20230630/20125371nr0v43uOBs.png
https://ithelp.ithome.com.tw/upload/images/20230630/20125371exZDpZJZ4N.png

思路:
明明程式碼都沒有動過,但是卻突然跳紅字,難道真的是因為我沒有買乖乖?

解決過程:
1.Unresolved reference: FragmentRegisterBinding餵狗得知有三種可能

2.嘗試過之後好像都沒有用。於是再找,發現了另一個可能

3.想到用Eclipse搞後端的時候也常常突然爆掉,這時候重開沒用的話也可以試試看的雙cleanhttps://ithelp.ithome.com.tw/upload/images/20230630/20125371ahKxz8ALTE.png

4.把dataBinding true 跟viewBinding true都刪掉->sync->加回來->sync
https://ithelp.ithome.com.tw/upload/images/20230630/20125371H5RCNMHkYu.png

6.成功ㄌhttps://ithelp.ithome.com.tw/upload/images/20230630/201253715AqirMnES3.png

雖然成功了但是好奇心驅使我扒一扒原因,於是我又把剛剛那兩個true刪掉並sync,執行Run後得到了
https://ithelp.ithome.com.tw/upload/images/20230630/201253710SGYLMJL3K.png
這裡找到了出錯誤的階段https://ithelp.ithome.com.tw/upload/images/20230630/20125371fcbBfLaUMK.png

a. 调用 aapt 生成项目和所有 aar 依赖的R.java b. 生成资源索引文件 c. 输出符号表
What's this?Ask Gpt!
https://ithelp.ithome.com.tw/upload/images/20230630/20125371TI2pJJi0EK.png
https://ithelp.ithome.com.tw/upload/images/20230630/201253711vBZEtaiyN.png

結論
好的,雖然還是不懂全部的意思,像是那些檔案具體來說長什麼樣子(因為我用Terminal遍歷整個資料夾還是找不到他們仨)
但至少變成人話了對吧,簡單來說這階段會做三件事,然後是跟把xml上面有寫binding的地方綁定到我的資料有關(例如說Strings?)
於是如果其中一個資料有錯,它就不會讓我執行的樣子


圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言