一个Android工程打包成APK时,遇到问题。出错类型为:
{
Duplicate id @ id/image, already defined earlier in this layout Issue: Checks for duplicate ids within a single layout Id: DuplicateIds Within a layout, id's should be unique since otherwise findViewById() can return an unexpected view.
}
和
{
This class should be public (android.support.v7.internal.widget.ScrollingTabContainerView.TabView)
Issue: Ensures that classes registered in the manifest file are instantiatable
Id: Instantiatable
Activities, services, broadcast receivers etc. registered in the manifest file must be "instantiatable" by the system, which means that the class must be public, it must have an empty public constructor, and if it's an inner class, it must be a static inner class.
[]
}
解决办法:
在引用的appcompat_v7 工程,右键:properties --> Android Lint Preferences-->Correctness下:单据选中提示的错误类型,修改器Severity:Fatal或Error为Warning。OK后,重新在原工程处导出APK,继续签名步骤。(如下图修改选中的instantiatable为Warning)