Android Studio Build APK沒有報錯,但是Generate signed apk報錯

來源:互聯網
上載者:User

標籤:html   nbsp   報錯   gen   strong   jar   plugin   ntop   target   

有時候 ,我們在調試APK,直接Build是可以正常產生,沒有報錯,但是當我們將自己的簽名檔案加上去,就會報錯。一般情況下,我們可以在build.gradle中的android{}裡面添加一個東西

    lintOptions {        checkReleaseBuilds false        abortOnError false    }

  整個檔案如下:

apply plugin: ‘com.android.application‘android {    compileSdkVersion 16    buildToolsVersion "26.0.1"    defaultConfig {        applicationId "com.zhongxuan.himclient"        minSdkVersion 11        targetSdkVersion 17    }    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‘)}

 參考連結:http://dditblog.com/itshare_657.html

還有一種錯誤

Error: Expected resource of type styleable [ResourceType] 
這個錯誤在編譯運行時候並不會出現,但是當需要編譯打包的時候,就會爆出這個異常。

這種錯誤,只需要在提示錯誤的類裡面加入這句:

@SuppressWarnings("ResourceType")

例如:

@SuppressWarnings("ResourceType")public void initView() {    TypedArray ta = mContext.obtainStyledAttributes(attrs);    boolean hasBottomLine = ta.getBoolean(0, false);    boolean hasTopLine = ta.getBoolean(1, false);    ta.recycle();}

參考連結:http://blog.csdn.net/zhufuing/article/details/50901133

Android Studio Build APK沒有報錯,但是Generate signed apk報錯

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.