当前位置: 首页 > 知识库问答 >
问题:

任务“:app:UploadCrashlyticSmappingFileRelease”执行失败。主机名不能为空

李耀
2023-03-14
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的Iam(从以前的版本升级)

Build#AI-201.8743.12.41.653283,构建于2020年11月5日运行时版本:1.8.0_242-Release-1644-B3-6222593 amd64 VM:OpenJDK 64位服务器VM by JetBrains S.R.O Linux 5.4.0-58-Generic GC:ParNew,ConcurrentMarkSweep内存:1246M Cores:4 Registry:ide.new.welcome.screen.force=true,External.System.auto.import.disabled=true,非绑定插件:com.android.tool.sizereduction.plugin

共有1个答案

齐承泽
2023-03-14

如果您使用的是Android Studio 4.0或以上版本,这个问题肯定会发生。您需要删除这些Crashlytics行从您的Gradle文件,因为它将自动管理由工作室。

build.grade(模块:app)

apply plugin: 'com.google.firebase.crashlytics
implementation 'com.google.firebase:firebase-crashlytics:X.X.X'

build.grade(项目:appname)

classpath 'com.google.firebase:firebase-crashlytics-gradle:X.X.X'
systemProp.http.proxyHost=
systemProp.http.proxyPort=80
systemProp.https.proxyHost=
systemProp.https.proxyPort=80
 类似资料: