gpt4 book ai didi

android - debug-apk 工作正常但在主要 Activity 上签名 apk 发布崩溃

转载 作者:行者123 更新时间:2023-11-29 00:57:22 24 4
gpt4 key购买 nike

调试 apk 运行良好但发布签名的 apk 在主要 Activity 上崩溃。我检查了一切,但我不知道问题出在哪里。[build.gradle][1]

   android {
compileSdkVersion 28
defaultConfig {
applicationId "com.newtrendsdeveloper.unorthodox"
minSdkVersion 19
targetSdkVersion 28
versionCode 51
versionName "4.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles 'proguard-rules.pro'
}
debug {}
}

flavorDimensions "color"
productFlavors {
blue {}
green {
applicationIdSuffix ".test"
versionNameSuffix "\"4.0-Microsoft Windows [Version 10.0.17134.407]\n" +
" (c) 2018 Microsoft Corporation. All rights reserved.\n" +
" \n" +
" C:\\Users\\HP\\Downloads\\Tusky-master\\Tusky-master\\app>\";" + getGitSha()
}
}

lintOptions {
disable 'MissingTranslation'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
androidExtensions {
experimental = true
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}

ext.supportLibraryVersion = '28.0.0'
ext.daggerVersion = '2.19'

//如果库在这里改变,它们也应该在LicenseActivity

中改变
dependencies {
implementation('com.mikepenz:materialdrawer:6.0.`enter code here`9@aar') {
transitive = true
}

最佳答案

很可能是您的 gradle 文件中的 minifyEnabled true。

这会删除未使用的代码并混淆代码。所以你可以查看什么是崩溃日志,可能是找不到类或空指针异常。检查缺少的内容,然后在构建输出中您可以搜索名为 usage.txt 的文件。这包括所有已删除的内容,您可以确保它已被删除。如果是,则修改混淆器规则以保留该类。

您可以查看文档以了解有关混淆器的更多信息: https://developer.android.com/studio/build/shrink-code

当然,检查这是否是问题所在的另一种方法是将 minifyEnabled 更改为 false,然后重试。如果可行,那么您可以将其重新打开并找出导致问题的原因。

关于android - debug-apk 工作正常但在主要 Activity 上签名 apk 发布崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53670370/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com