合并代码之后,项目无法运行,报错如下:
AGPBI: {"kind":"error","text":"error: resource drawable/nim_list_item_selector (aka com.rise.planner:drawable/nim_list_item_selector) not found.","sources":[{"file":"/Users/jake/Documents/code/riseon-planner-android/lib_nim/build/intermediates/packaged_res/debug/values/values.xml","position":{"startLine":828,"startColumn":4,"startOffset":40313,"endLine":834,"endColumn":12,"endOffset":40743}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: resource drawable/nim_list_item_selector (aka com.rise.planner:drawable/nim_list_item_selector) not found.","sources":[{"file":"/Users/jake/Documents/code/riseon-planner-android/lib_nim/build/intermediates/packaged_res/debug/values/values.xml","position":{"startLine":835,"startColumn":4,"startOffset":40748,"endLine":842,"endColumn":12,"endOffset":41195}}],"original":"","tool":"AAPT"}
解决
亲爱的,我只想劝劝你,如果是合并代码之后发生的,请坚信就是代码合并冲突导致的,可能编译器抽风,没有报出详细的错。
我提交了错误的代码到gitlab,让同事试一试,然后诡异的事情发生了:我们两个报错不同,而且指出了详细的代码冲突的位置
<<<<<<< HEAD:lib_nim/res/drawable/bg_gradient_msg_f5576c_ff9a9e.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#FF9A9E"
android:startColor="#F5576c" />
=======
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:endColor="#FFC795"
android:startColor="#FF922C" />
>>>>>>> a483b5fbeca60a97df83808586c22dd548666fc5:lib_nim/res/drawable/bg_gradient_msg_ffc795_ff922c.xml
</shape>
解决完冲突之后,就可以正常运行了。
后来
我不甘心,就这样被编译器耍了,然后恢复错误,再次运行。
发现我再也找不回之前的报错了。
又一次被编译器耍了...
查看编译器报错详情界面
写在最后
或许我们可以全局搜索 ======= 或 >>>>>>>
来找到冲突的位置,只能下次遇到,再试一试了!
网友评论