Sometimes, we are debugging the APK, the direct build can be generated normally, no error, but when we add their own signature file, will be an error. In general, we can add a thing to android{} in Build.gradle.
lintoptions { Checkreleasebuilds false abortonerror false }
The entire file is as follows:
Apply plugin: ' Com.android.application ' android { compilesdkversion buildtoolsversion "26.0.1" defaultconfig { ApplicationID "com.zhongxuan.himclient" minsdkversion one targetsdkversion } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile (' Proguard-android.txt '), ' Proguard-rules.txt ' } } lintoptions { checkreleasebuilds false Abortonerror false }}dependencies { compile files (' Libs/zxing.jar ') compile files (' libs/ Gson-2.6.1.jar ') compile files (' Libs/xutils-2.6.14.jar ')}
Reference Link: http://dditblog.com/itshare_657.html
There's another mistake.
error:expected Resource of type styleable [ResourceType]
This error does not occur when the compilation is run, but it can be thrown out when the package needs to be compiled.
This error, only need to add this sentence in the class that prompts the wrong:
@SuppressWarnings ("ResourceType")
For example:
@SuppressWarnings ("ResourceType")publicvoid Initview () { = Mcontext.obtainstyledattributes (attrs); Boolean false ); Boolean false ); Ta.recycle ();}
Reference Link: http://blog.csdn.net/zhufuing/article/details/50901133
Android Studio Build apk has no error, but generate signed APK error