java - 将 debuggable 设置为 false 时,发布构建运行方式不同
问题描述
在 Android Studio 中,在Module Settings -> Build Types中,debuggable设置为false。我像这样运行发布版本,现在我的程序表现不同,并且不能按照我想要的方式工作。奇怪的是,当我运行相同的发布版本但debuggable设置为true时,程序运行正常(当构建变体设置为调试时我最初构建程序的方式)。
为什么我的程序会这样?
在我最初的调试版本中,游戏的整个屏幕都有一个ImageView
响应onTouch
事件的按钮。在该onTouch
方法中,它首先检查是否启用了用户输入,如果是,则处理它(这似乎在某些时候不起作用)
构建梯度:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.dark_maze_signature
debuggable false
}
debug {
debuggable true
}
}
依赖项:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.android.gms:play-services-identity:15.0.1'
implementation 'com.google.android.gms:play-services-games:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-games:15.0.1'
implementation 'com.unity3d.ads:unity-ads:2.2.0'
implementation 'com.google.ads.mediation:unity:2.2.0.0'
implementation('com.vungle:publisher-sdk-android:5.3.2@aar') {
transitive = true
}
implementation 'com.google.ads.mediation:vungle:5.3.2.1'
}
解决方案
推荐阅读
- linux - 如何确保托管服务提供商无法访问我的秘密?
- python - 如果每行用空格分隔,如何在多行文本字符串中实现左对齐?
- django - Django中的日期时间
- python - 字典问题(TypeError:字符串索引必须是整数)
- python-3.x - 记录已删除消息并检索执行程序的 Discord.py BOT
- erlang - Ejabberd 顺序与并行服务器
- javascript - D3.js v7 - 如何使 Y 轴标签始终显示在屏幕上以用于可滚动图表
- python - 如何按括号顺序将字符串分成块?
- mysql - 如何根据另一个列值连接 SQL 中的列值
- android - Dart Elipsis 在 else 之后