Android Studio打包APK是遇到的一些问题(Lint检查的错误)

一,Error* : expected resource of type drawable
 原因: animation-list的文件放在anim文件夹下了
 解决的两种方式:
   1,移动文件到drawable文件夹下
   2,替换
      _loadigIcon.setImageResource(R.anim.loading_animation);
   为
      _loadigIcon.setImageResource(+R.anim.loading_animation);


二、obtainStyledAttributes annotated with @StyleableRes. Suppress warnings(expected resource of type
   原因:TypedArray ta = obtainStyledAttributes(R.style.MyCustomStyle, attrs)
   解决:(在它的函数上添加)
     @SuppressWarnings("ResourceType")



三、Android xxx is not translated in zh
     原因:在默认的strings.xml中有值,但是在values-zh文件夹下的srings.xml中没有值导致
    
   Lint的终极解决办法:
          在主项目的builde.gralde里添加如下代码

	android {
		lintOptions {
			checkReleaseBuilds false
			// Or, if you prefer, you can continue to checkforerrorsinrelease builds,
			// but continue the build even whenerrorsarefound:
			abortOnError false
		}
	}


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值