DataDog / dd-sdk-android-gradle-plugin

The Datadog Gradle Plugin for Android
Apache License 2.0
14 stars 9 forks source link

Uploading mapping file using dexguard - API KEY error ( verify that you're using a valid API KEY) #210

Open methob opened 9 months ago

methob commented 9 months ago

Thanks for taking the time for reporting an issue!

Describe what happened

Hello, I'm currently trying to send the mapping file to datadog after building the application using dexguard, but I'm always getting an invalid API KEY error, as I put the API we usually use in the project

Include any error message or stack trace if available.

I tried to set the API KEY by setting the environment variable or via the json file and it had no effect

that's the configuration of datadog in gradle

datadog {
    variants {
        release {

            mappingFilePath = "$rootProject.projectDir/app/build/outputs/dexguard/mapping/${getArtefactName()}/prd/release/mapping.txt"

            nonDefaultObfuscation = true
        }
    }
}

and the datadog-ci.json are in the root of the project with only the property apiKey

Steps to reproduce the issue:

Describe what you expected:

Additional context

xgouchet commented 9 months ago

Hi @methob ,

please note that the API Key you need to use to upload the mapping file is not the one that you use in your application. The latter is called a Client Token, and has very little permissions attached to it, and will always start with pub followed by 32 hexadecimal characters. An API Key only has 32 hex characters, and has more permissions attached to it (including uploading mapping files). You can create an API Key by going in your organisation's settings, then API Key.