How to publish native code symbols to Google Play console?
Asked Answered
W

1

13

I am trying to publish an Android application to Google Play and getting a warning:

This App Bundle contains native code, and you've not uploaded debug symbols. 
We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug.

I found in one documentation, that I should add

android.buildTypes.release.ndk.debugSymbolLevel = { SYMBOL_TABLE | FULL }

line to build.gradle file and in another documentation, tha I should add

android.defaultConfig.ndk.debugSymbolLevel = 'FULL'

line to build.gradle file.

Which one is correct?

Anyway, neither is working.

If I add the line (as is) to build.gradle (literally following the documentation), I am getting Gradle errors that it can't find ndk or debugSymbolLevel names.

If I add the line (as is) to gradle.properties, than it has no effect: aab file appears having the same size and the warning persists.

How to accomplish?

Wichman answered 13/8, 2020 at 12:2 Comment(1)
S
11

Both options will work. If you use android.defaultConfig.ndk.debugSymbolLevel it will apply it to all build types (i.e., both debug and release builds). On the other hand, if you use android.buildTypes.release.ndk.debugSymbolLevel it will apply only to your release build.

These options have to be added into your app/build.gradle file, which would look a bit like this:

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId 'com.example.foo'
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 42
        versionName "4.0.2"
        ndk {
            debugSymbolLevel 'SYMBOL_TABLE'
        }
    }
    // Rest of the file
}

HTH

Struma answered 14/8, 2020 at 21:19 Comment(3)
Hi Alberto, I followed your suggestion but unfortunately Play Console still fail in found ing debug symbol file inside the AAB. Any idea? Thank you.Canasta
same here, don't know why. Really upset nowMicropaleontology
for me it only worked when I give 'symbol_table' in small case.Bedfast

© 2022 - 2024 — McMap. All rights reserved.