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
Android Studio Build APK没有报错,但是Generate signed apk报错的更多相关文章
- TensorFlow Android Camera Demo 使用android studio编译安装和解决Execution failed for task ':buildNativeBazel'报错
可以参考官网:https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android#android-stud ...
- Android Studio Build选项的功能
再开发过程中出现了如下错误: 无论如何clean,或者删除项目中build文件夹,Rebuild Project还是报错. 解决方案:Make Project 后出现有代码报错.修复代码问题,运行项目 ...
- Android Studio打包没有Generate signed apk选项 解决方法
原文地址:https://www.jianshu.com/p/9e02e55f0ba8 1.点击build栏目-并没有Generate signed apk选项 2.点击file,选中如下图所示Syn ...
- 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: ...
- Androidstudio下Generate signed apk提示Error: Expected resource of type id [ResourceType]解决办法
只需要在报错位置所在的类上面添加: @SuppressWarnings("ResourceType") 即可实现Generate signed apk.
- 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 ...
- 使用Android Studio build tensorflow/examples/android——直接用android studio即可
使用Android Studio 可以在Android Studio中直接打开tensorflow/examples/android,但是需要配置好你的gradle.sdk.ndk gradle必须要 ...
- 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 ...
- (转)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 ...
- 关于android studio中使用class.forname()方法动态获取类实例报NO CLASS FOUND异常的几种处理方法
最近在做一个项目的时候需要用到反射来回调子类的方法,但是在反射过程中总是在class.forname()方法抛出NO CLASS FOUND异常,经过几部检查,问题解决,在此总结一下引起该问题的原因 ...
随机推荐
- java:BufferedReader接受输入进来的2个数字,并将它们相加
java:BufferedReader接受输入进来的2个数字,并将它们相加 //接受输入进来的2个数字,并将它们相加 BufferedReader buf = null; buf = new Buff ...
- django实现日期分类效果
日期分类效果图 实现功能:能够按照月份进行分类,统计每个月份的文章数量,没有文章的月份不显示.点击每栏可以链接的当月的文章列表. 每月文章列表可以使用django的通用视图MonthArticleVi ...
- 解决:在Eclipse中运行monkeyrunner脚本报错: IOError: (2, 'File not found - D:\\workspace\\monkeyrunner_test01 (\u62d2\u7edd\u8bbf\u95ee\u3002)')
在eclipse中搭建运行monkeyrunner脚本的环境,请见lynnLi的博客monkeyrunner之eclipse中运行monkeyrunner脚本之环境搭建(四) 但在实践中,状况确实层出 ...
- Codeforces 610D Vika and Segments 线段树+离散化+扫描线
可以转变成上一题(hdu1542)的形式,把每条线段变成宽为1的矩形,求矩形面积并 要注意的就是转化为右下角的点需要x+1,y-1,画一条线就能看出来了 #include<bits/stdc++ ...
- 理解AOP思想(面向切面编程)
AOP:面向切面编程,相信很多刚接触这个词的同行都不是很明白什么,百度一下看到下面这几句话: 在软件业,AOP为Aspect Oriented Programming的缩写,意为:面向切面编程,通过预 ...
- Nodejs调试技术总结
调试技术与开发技术构成了软件开发的基石.目前Nodejs作为新型的Web Server开发栈倍受开发者关注.总的来说Nodejs的应用程序主要有两部分:JavaScript编写的js模块和C语言编译的 ...
- 在OpenCV2.2后的版本中没有CvvImage类的解决方法(及出现错误:IntelliSense: 未定义标识符 "CvvImage" )
首先在你的解决方案资源管理器中的头文件和源文件下分别添加 CvvImage.cpp 如下图: view类头上加个#include "CvvImage.h" 头文件,应该就可以解决 ...
- https页面 和 http请求的问题
(1)强制升级http 静态资源地址为https地址 https页面中不能使用http请求,http页面中可以使用https请求. 关于在https 页面有一些http的请求,可以在<head& ...
- 元素为指针的vector的使用说明
该程序演示了vector中的元素为指针的时候的对对象的操作. /* 功能说明: 元素为指针的vector的使用说明 实现方式: 使用this成员来显示各个对象的地址. 限制条件或者存在的问题: 无 * ...
- 1109. Group Photo (25)
Formation is very important when taking a group photo. Given the rules of forming K rows with N peop ...