有时候 ,我们在调试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报错的更多相关文章

  1. TensorFlow Android Camera Demo 使用android studio编译安装和解决Execution failed for task ':buildNativeBazel'报错

    可以参考官网:https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android#android-stud ...

  2. Android Studio Build选项的功能

    再开发过程中出现了如下错误: 无论如何clean,或者删除项目中build文件夹,Rebuild Project还是报错. 解决方案:Make Project 后出现有代码报错.修复代码问题,运行项目 ...

  3. Android Studio打包没有Generate signed apk选项 解决方法

    原文地址:https://www.jianshu.com/p/9e02e55f0ba8 1.点击build栏目-并没有Generate signed apk选项 2.点击file,选中如下图所示Syn ...

  4. Android Generate Signed APK: Errors while building APK. You can find the errors )

    开发过程中,总会遇到很多坑: Gradle build finished with 101 error(s) in 1m 35s 424ms 19:23:50 Generate Signed APK: ...

  5. Androidstudio下Generate signed apk提示Error: Expected resource of type id [ResourceType]解决办法

    只需要在报错位置所在的类上面添加: @SuppressWarnings("ResourceType") 即可实现Generate signed apk.

  6. Android Studio解决unspecified on project app resolves to an APK archive which is not supported

    出现该问题unspecified on project app resolves to an APK archive which is not supported as a compilation d ...

  7. 使用Android Studio build tensorflow/examples/android——直接用android studio即可

    使用Android Studio 可以在Android Studio中直接打开tensorflow/examples/android,但是需要配置好你的gradle.sdk.ndk gradle必须要 ...

  8. Android Studio 解决unspecified on project app resolves to an APK archive which is not supported

    出现该问题unspecified on project app resolves to an APK archive which is not supported as a compilation d ...

  9. (转)Android Studio解决unspecified on project app resolves to an APK archive which is not supported

    出现该问题unspecified on project app resolves to an APK archive which is not supported as a compilation d ...

  10. 关于android studio中使用class.forname()方法动态获取类实例报NO CLASS FOUND异常的几种处理方法

    最近在做一个项目的时候需要用到反射来回调子类的方法,但是在反射过程中总是在class.forname()方法抛出NO CLASS FOUND异常,经过几部检查,问题解决,在此总结一下引起该问题的原因 ...

随机推荐

  1. Python之单例模式总结

    一.单例模式 a.单例模式分为四种:文件,类,基于__new__方法实现单例模式,基于metaclass方式实现 b.类实现如下: class Sigletion(objects): import t ...

  2. 机器学习三剑客之Numpy

      Numpy NumPy是Python语言的一个扩充程序库.支持高级大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库.Numpy内部解除了Python的PIL(全局解释器锁),运算效 ...

  3. Oracle通过PLSQL进行数据表之间的同步

    昨天被要求拉取第三方oracle中的一个表数据,起初以为要导出表数据,然后再自己库中建个相同的表,然后导入数据,查过资料之后oracle可以通过dblink的方式同步表数据. 1.首先利用PLSQL工 ...

  4. SpringBoot发布到独立的tomcat中运行

    在此文基础上 Eclipse下利用Maven创建SpringBoot的Restful风格程序 spring-boot默认提供内嵌的tomcat,所以打包直接生成jar包,用java -jar命令就可以 ...

  5. 理解AOP思想(面向切面编程)

    AOP:面向切面编程,相信很多刚接触这个词的同行都不是很明白什么,百度一下看到下面这几句话: 在软件业,AOP为Aspect Oriented Programming的缩写,意为:面向切面编程,通过预 ...

  6. AI探索(四)NumPy库的使用

    NumPy(Numerical Python) 是 Python 语言的一个扩展程序库,支持大量的维度数组与矩阵运算,此外也针对数组运算提供大量的数学函数库. umPy 是一个运行速度非常快的数学库, ...

  7. LeetCode OJ:Summary Ranges(概括区间)

    Given a sorted integer array without duplicates, return the summary of its ranges. For example, give ...

  8. cocos2d-html5 中的性能优化

    游戏开发中,难免会遇到性能瓶颈.图片一多,渲染批次就会直线上升,任何动画都会变得闪动. OpenGL ES优化的问题,主要考虑两个方面:内存存储和运行速度. 2D游戏中的最占内存的就是图片资源,一张图 ...

  9. eclipse 环境 JUnit 测试框架(junit.framework.* 与 org.junit.*)

    如下所示,先通过 build path 导入 junit 环境依赖的 jar 包: 1. junit.framework.* junit.framework.* 主要类和函数: Test TestCa ...

  10. 异步通信rabbitmq——消息重试

    目标: 利用RabbitMQ实现消息重试和失败处理,实现可靠的消费消费.在消息消费异常时,自动延时将消息重试,当重试超过一定次数后,则列为异常消息,等待后续特殊处理. 准备: TTL:Time-To- ...