java.nio.file.InvalidPathException: Illegal char <:> at index 48异常问题解决
·
问题分析:java.nio.file.InvalidPathException: Illegal char <:> at index 48: packageName-mergeDebugResources-52:/values/values.xml出现这种问题我们很难排除具体问题出现在哪里,因为我们编译打包的时候会将所有资源文件合并到values.xml里面,即build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml里面我们即使知道这里面有字符串是有问题的也很难直接定位到具体字符串的位问题
问题定位:首先我们可以看看values里面的colors、strings、styles、attrs等文件里面的字符串是否有问题,排除无问题大概率就是文件命名的问题了,即命名重复了,可以对attrs.xml里面的属性进行全局搜索,看看是否跟其它library库重复命名的,比如下面DownloadProgress里面的属性,最好都根据库的名称当前缀去命名,正常就可以解决问题,上面问题就是由于DownloadProgress里面的部分属性跟其它库里面的属性命名冲突导致。
<declare-styleable name="DownloadProgress">
<attr name="bgProgress" format="integer" />
<attr name="backgroundText" format="string|dimension" />
<attr name="bgTextSize" format="integer|dimension" />
<attr name="bgTextColor" format="color" />
<attr name="bgColor" format="color" />
<attr name="bgProColor" format="color" />
</declare-styleable>
更多推荐



所有评论(0)