Skip to content

Build issue when generating Crashlytics symbole files #6139

Closed

Description

@Thortoco

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Ladybug | 2024.1.3 Canary 3
  • Firebase Component: Crashlytics
  • Component version: 19.0.3

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

When running the command to bundle our application, we get the following error:

> Task :app:generateCrashlyticsSymbolFileAppNameRelease FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:generateCrashlyticsSymbolFileAppNameRelease'.
java.io.IOException: Breakpad symbol generation failed (exit=1), see STDERR

We launch the following command to bundle our application:

./gradlew app:bundleAppNameRelease

This issue happens when trying to bump the firebase BOM from 32.8.1 to 33.1.2.
While doing this change we also bump the following dependencies:

  • Firebase gradle from 3.2.0 to 5.0.0
  • Firebase Crashlytics gradle from 2.9.9 to 3.0.2
  • Google Services From 4.3.15 to 4.4.2

Relevant Code:

In our app build.gradle this is our CrashlyticsExtension configuration

configure<CrashlyticsExtension> {
                nativeSymbolUploadEnabled = true
}

and our bundle split

bundle {
        language {
            enableSplit = false
        }
        density {
            enableSplit = true
        }
        abi {
            enableSplit = true
        }
    }

Thanks

Activity

  1. lehcar09 commented on Jul 31, 2024

    @lehcar09
    Contributor

    Hi @Thortoco, thank you for reaching out. I tried reproducing the issue, however, I did not encounter the error.

    This is my build.gradle file:

    
    plugins {
        alias(libs.plugins.android.application)
        alias(libs.plugins.jetbrains.kotlin.android)
        alias(libs.plugins.google.gms.google.services)
        alias(libs.plugins.google.firebase.crashlytics)
    }
    
    android {
        namespace '<name>'
        compileSdk 34
    
        defaultConfig {
            applicationId "<name>"
            minSdk 24
            targetSdk 34
            versionCode 1
            versionName "1.0"
    
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }
    
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
                firebaseCrashlytics {
                    mappingFileUploadEnabled = true
                    nativeSymbolUploadEnabled = true
                }
            }
            debug {
                firebaseCrashlytics {
                    mappingFileUploadEnabled = true
                    nativeSymbolUploadEnabled = true
                }
            }
        }
    
        bundle {
            language {
                enableSplit = false
            }
            density {
                enableSplit = true
            }
            abi {
                enableSplit = true
            }
        }
    
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        kotlinOptions {
            jvmTarget = '1.8'
        }
        externalNativeBuild {
            cmake {
                path file('src/main/cpp/CMakeLists.txt')
                version '3.22.1'
            }
        }
        buildFeatures {
            viewBinding true
        }
    }
    
    dependencies {
        implementation libs.androidx.core.ktx
        implementation libs.androidx.appcompat
        implementation libs.material
        implementation libs.androidx.constraintlayout
        implementation libs.firebase.crashlytics
    
        testImplementation libs.junit
        androidTestImplementation libs.androidx.junit
        androidTestImplementation libs.androidx.espresso.core
    }
    

    Did I miss anything?

    I'm not sure if it's just a typo error, but, just to note, if you're using Groovy DSL, you should use the firebaseCrashlytics extension. You can check this documentation for reference.

    To add, the Crashlytics Gradle v3 plugin (3+) is a major version and modernizes the SDK by dropping support for lower versions of Gradle and the Android Gradle plugin. For more details, you can check this documentation.

  2. Thortoco commented on Aug 2, 2024

    @Thortoco
    Author

    Hello @lehcar09 thanks for your answer,

    The main difference I see between our code is that on our side, we have minifyEnabled set to true in our build.gradle.

    For the firebaseCrashlytics, it's not a typo we use configure<CrashlyticsExtension> as it is the recommended way in gradle.kts (as also mentioned in your documentation link).

    I will try in an isolated project your setup.

  3. lehcar09 commented on Aug 6, 2024

    @lehcar09
    Contributor

    Thank you for the clarification @Thortoco. I set the isMinifyEnabled to true, but, I still wasn't able to encounter the issue.

    Screenshot 2024-08-06 at 7 38 32 PM

    Can you share with me the Android Gradle plugin you're using?

  4. Thortoco commented on Aug 9, 2024

    @Thortoco
    Author

    Hello @lehcar09 I am using the 8.3.2 version of the gradle plugin com.android.tools.build:gradle

    I just tried with 8.5.0 and I have the same error.

  5. lehcar09 commented on Aug 12, 2024

    @lehcar09
    Contributor

    If any chance, can you share an MCVE to help us investigate the issue? If you're unable to provide one, can you try our quickstart app and see if you can reproduce the issue? Thanks!

  6. google-oss-bot commented on Aug 19, 2024

    @google-oss-bot
    Collaborator

    Hey @Thortoco. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

    If you have more information that will help us get to the bottom of this, just add a comment!

  7. cymerio commented on Aug 21, 2024

    @cymerio

    I have the same issue, but only in my CI environment, in my dev machine it works.
    Downgrading Firebase Crashlytics gradle from 3.0.x to 2.9.9 solves the issue.

    Can't share the project, but I'm using:

    • Gradle 8.7
    • AGP 8.5.2
    • google-services plugin 4.4.2
    • firebase-crashlytics-gradle plugin 3.0.0, 3.0.1, 3.0.2 - none work, 2.9.9 works

    This is an old project, so the gradle files are in Groovy and use the old plugin application with buildscript.
    Not using bundles. Native symbol upload is enabled.

    My CI env:

    • Ubuntu 18.04.6 LTS
    • openjdk 17.0.7 2023-04-18 (installed from the standard Ubuntu repos with apt install openjdk-17-jdk)

    My dev machine:

    • Ubuntu 22.04.4 LTS
    • openjdk 17.0.11 2024-04-16 (also installed with apt install openjdk-17-jdk)

    In app/build/crashlytics/appName/dump_syms/ I see that a dump-syms.bin file was generated, but in app/build/crashlytics/appName/nativeSymbols I see only an empty file (libcrashlytics-common.soSOMENUMBERS.tmp).

  8. Thortoco commented on Aug 22, 2024

    @Thortoco
    Author

    Hello If I can jump on what you said @cymerio the issue also only happens on our CI that is configured as such:

    • Ubuntu 20.04.4 LTS
    • openjdk 17.0.11 2024-04-16 (with apt install openjdk-17-jdk)

    So the same configuration as you for your dev machine but still we have the issue.
    Could it be something missing on the CI env that would lead to this build issue?

  9. google-oss-bot commented on Aug 29, 2024

    @google-oss-bot
    Collaborator

    Hey @Thortoco. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

    If you have more information that will help us get to the bottom of this, just add a comment!

  10. google-oss-bot commented on Sep 5, 2024

    @google-oss-bot
    Collaborator

    Since there haven't been any recent updates here, I am going to close this issue.

    @Thortoco if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

  11. Thortoco commented on Sep 12, 2024

    @Thortoco
    Author

    Hello, after updating our CI to the latest ubuntu LTS 24.04 we don't have the issue anymore.

  12. cymerio commented on Sep 17, 2024

    @cymerio

    Hello again. I have an update.
    The build failure disappeared when I migrated the Groovy scripts to Kotlin.

    And I also have repro steps:

    1. With Android Studio Koala Feature Drop 2024.1.2 (current stable), generate a new project using the new project wizard. Select "No Activity". In the next page of the wizard, in "Build configuration language" choose "Groovy DSL (build.gradle)".
    2. Add this at the bottom of gradle/libs.versions.toml:
    google-services = { id = "com.google.gms.google-services", version = "4.4.2" }
    firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "3.0.0" }
    
    1. Add the plugins to the root project's build.gradle:
    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    plugins {
        alias(libs.plugins.android.application) apply false
        alias(libs.plugins.kotlin.android) apply false
        alias(libs.plugins.google.services) apply false         // add this
        alias(libs.plugins.firebase.crashlytics) apply false    // add this
    }
    
    1. In app/build.gradle, add and apply the plugins, enable nativeSymbolUploadEnabled and add an externalNativeBuild, like this:
    plugins {
        alias(libs.plugins.android.application)
        alias(libs.plugins.kotlin.android)
        alias(libs.plugins.google.services)      // add this
        alias(libs.plugins.firebase.crashlytics) // add this
    }
    
    android {
        // ...
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
                firebaseCrashlytics {                             // add this
                    nativeSymbolUploadEnabled = true              // add this
                }                                                 // add this
            }
        }
        externalNativeBuild {                                     // add this
            cmake {                                               // add this
                path "src/main/cpp/CMakeLists.txt"                // add this
            }                                                     // add this
        }                                                         // add this
        // ...
    }
    
    1. Create app/src/main/cpp/CMakeLists.txt:
    project(test)
    cmake_minimum_required(VERSION 3.4.1)
    add_library(mylib SHARED mylib.c)
    
    1. Create app/src/main/cpp/mylib.c:
    #include <stdio.h>
    void mylib_func() {
        printf("Hello, World!\n");
    }
    
    1. Put the google-services.json in app/src/google-services.json
    2. Run ./gradlew clean assembleRelease uploadCrashlyticsSymbolFileRelease
      (the task that triggers the failure is uploadCrashlyticsSymbolFileRelease)

    So, basically it's reproduced with the most minimal example that has the build scripts in Groovy and has native code. But it's only triggered in an old system.

  13. locked and limited conversation to collaborators on Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions