Android Studio Build apk has no error, but generate signed APK error

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.