zoukankan      html  css  js  c++  java
  • Android Studio Build APK没有报错,但是Generate signed apk报错

    有时候 ,我们在调试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

  • 相关阅读:
    [NOIP2008] 传纸条
    [NOIP2006] 能量项链
    [poj2393] Yogurt factory
    [poj3069] Saruman's Army
    [NOIP2011] 观光公交
    [NOIP2010] 关押罪犯
    [洛谷2744] 量取牛奶
    [poj3281] Dining
    关于几类STL容器的swap复杂度问题
    折半法
  • 原文地址:https://www.cnblogs.com/linfenghp/p/7730444.html
Copyright © 2011-2022 走看看