【发布时间】:2021-04-05 20:53:28
【问题描述】:
在尝试创建发布签名的 apk 时,构建在任务中失败app:uploadCrashlyticsMappingFileRelease'.Host name must not be empty.
我已启用混淆。
buildTypes {
release {
minifyEnabled true // Enables code shrinking, obfuscation, and optimization
shrinkResources true // Enables resource shrinking, which is performed by the Android Gradle plugin
firebaseCrashlytics {
mappingFileUploadEnabled true
}
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
另外,使用
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
implementation 'com.google.firebase:firebase-auth:20.0.1'
implementation 'com.google.firebase:firebase-firestore:22.0.1'
implementation 'com.google.firebase:firebase-core:18.0.0'
//the Firebase SDK for Google Analytics.
implementation 'com.google.firebase:firebase-analytics:18.0.0'
//the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
和,
classpath 'com.google.gms:google-services:4.3.4' // Google Services plugin
// Add the Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
有人遇到同样的问题吗? 我尝试清除 gradle 缓存并删除 crashlytics 依赖项,因为我读到它将由 Android Studio 自动处理,但那时不会记录崩溃。
我使用的是 Android Studio 4.1.1(从之前的版本升级)
Build #AI-201.8743.12.41.6953283,构建于 2020 年 11 月 5 日运行时 版本:1.8.0_242-release-1644-b3-6222593 amd64 VM:OpenJDK 64 位 JetBrains s.r.o Linux 5.4.0-58-generic GC 的服务器 VM:ParNew, ConcurrentMarkSweep 内存:1246M 内核:4 注册表: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true 非捆绑插件: com.android.tool.sizereduction.plugin 当前桌面:ubuntu:GNOME。
【问题讨论】:
标签: android android-studio proguard obfuscation crashlytics