mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
Handle unknown resource types while creating resource tables (#566)
This commit is contained in:
+8
-2
@@ -229,8 +229,14 @@ internal object DefaultResourceTableRegistry : ResourceTableRegistry {
|
||||
if (typeName.contains('-')) {
|
||||
typeName = typeName.substringBefore('-')
|
||||
}
|
||||
|
||||
val resName = ResourceName(pck, AaptResourceType.valueOf(typeName.uppercase()), file.nameWithoutExtension)
|
||||
|
||||
val type = try {
|
||||
AaptResourceType.valueOf(typeName.uppercase())
|
||||
} catch (error: Exception) {
|
||||
log.warn("Unknown resource type:", typeName.uppercase(), error.message)
|
||||
AaptResourceType.UNKNOWN
|
||||
}
|
||||
val resName = ResourceName(pck, type, file.nameWithoutExtension)
|
||||
table.addFileReference(resName, ConfigDescription(), Source(file.path), file.path)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user