
Android resource linking failed
com.example.test3.app-mergeDebugResources-17:/values/values.xml:1213: error: resource color/colorPrimary (aka com.example.test3:color/colorPrimary) not found.
com.example.test3.app-mergeDebugResources-17:/values/values.xml:1214: error: resource color/colorPrimaryDark (aka com.example.test3:color/colorPrimaryDark) not found.
com.example.test3.app-mergeDebugResources-17:/values/values.xml:1215: error: resource color/colorAccent (aka com.example.test3:color/colorAccent) not found.
com.example.test3.app-mergeDebugResources-17:/values/values.xml:1213: error: resource color/colorPrimary (aka com.example.test3:color/colorPrimary) not found.
com.example.test3.app-mergeDebugResources-17:/values/values.xml:1214: error: resource color/colorPrimaryDark (aka com.example.test3:color/colorPrimaryDark) not found.
com.example.test3.app-mergeDebugResources-17:/values/values.xml:1215: error: resource color/colorAccent (aka com.example.test3:color/colorAccent) not found.
error: failed linking references.
我想说,如果在网上其他地方找了很长时间找到的方法都没有解决你的问题,那就去检查一下你的代码,代码写的有问题也可能会出现这样的bug
例如像这种:

这里的错误并不会有红色下划曲线的那种错误提示,但是飘红可能就代表有问题
在Android开发中遇到resource linking failed和error: failed linking references的问题。错误涉及color/colorPrimary、color/colorPrimaryDark和color/colorAccent资源未找到。检查代码是解决这类问题的关键,即使代码没有红色下划线警告,也可能存在潜在问题。
1348





