java程序一写文件就崩溃_java – 应用程序仅在发行版本中崩溃

你在

android.support.v4.widget.drawerlayout获得

NullPointerException

NullPointerException is thrown when an application attempts to use an

object reference that has the null value.

NullPointerException如何仅在版本apk上启动?

When you prepare your application for release, you configure, build,

and test a release version of your application. The configuration

tasks are straightforward, involving basic code cleanup and code

modification tasks that help optimize your application.

>阅读Prepare for Release

> set minifyEnabled false

你可以像这样自定义你的build.gradle

buildTypes {

debug {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

debuggable false

zipAlignEnabled true

jniDebuggable false

renderscriptDebuggable false

}

}

确保使用稳定的支持库和构建工具.

compileSdkVersion 24

buildToolsVersion "24.0.2"

compile 'com.android.support:appcompat-v7:24.2.0'

compile 'com.android.support:design:24.2.0'

项目级别

classpath 'com.android.tools.build:gradle:2.1.2' // or 2.2.2

然后

On the main menu, choose File | Invalidate Caches/Restart. The

Invalidate Caches message appears informing you that the caches will

be invalidated and rebuilt on the next start. Use buttons in the

dialog to invalidate caches, restart Android Studio .

注意:您可以为我们提供您的build.gradle.禁用“即时运行”设施.

.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值