79
votes

When I want to release a new flutter app bundle to the Playstore. I get this error: "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 can't find any way to fix this. I'm new with flutter and releasing app's and getting a bit desperate... Any help would be fantastic.

When I add "android.defaultConfig.ndk.debugSymbolLevel = 'FULL'" (on line 1) to the app/build.gradle as suggested in https://developer.android.com/studio/preview/features#native-crash-symbolization. I get This error in the Android studio terminal. I use this command "flutter build appbundle".

Error in Terminal: FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\filip\AndroidStudioProjects\ehbo\android\app\build.gradle' line: 1

  • What went wrong: A problem occurred evaluating project ':app'.

Could not get unknown property 'android' for project ':app' of type org.gradle.api.Project.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 3s Running Gradle task 'bundleRelease'... Running Gradle task 'bundleRelease'... Done 4,3s Gradle task bundleRelease failed with exit code 1

7
It seems you need to upload deobfuscation / symbolication file . check below link: support.google.com/googleplay/android-developer/answer/… - vinodaw
It's just beta problems, this functionality is not in stable gradle release yet, only in 4.1 So looks like Play console beta is for android studio beta now. - Shakle

7 Answers

40
votes

Before you can upload debug symbols files, you must be using Android Gradle plugin version 4.1 or higher.

Looks like it will come only with Android Studio 4.1, because I can only get Gradle 4.0.0 automatically now.

So I suggest you to return classic Play console and it will let you through :)

25
votes

If talking about Flutter, looks like the Flutter team needs to change some source files for the NDK, because it does not see where from to generate debug symbols.

Here is an issue thread: https://github.com/flutter/flutter/issues/60240

Setup steps are so:

  • Pre-condition: Intall Android studio 4.1+ and Gradle 4.1+
  1. Install NDK (Side by Side) in SDK manager enter image description here

  2. Write path to NDK in local.properties enter image description here

  3. Add in app/build.gradle (last line) android.buildTypes.release.ndk.debugSymbolLevel = 'FULL' enter image description here

18
votes

The Answer was given by Shakle will be not useful as per the following message on Play Console.

The old version of Play Console will be discontinued from November 2, 2020 You’re already using the new Play Console, so you don’t need to do anything. A few features are going away if you want to check them one last time.

It's just a warning, nothing else. Just go ahead.

If you don't want any warning, Go to this link and follow the steps:

https://support.google.com/googleplay/android-developer/answer/9848633?hl=en

You can use the new version of the play store as it is.

4
votes

you can make these zip file by go to build\app\intermediates\merged_native_libs\release\out\lib inside your flutter project

and compress the folders into symbols.zip , now upload it into the google play console

3
votes

If you want to solve this warning error: 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. Learn More

This will happen if your gradle version is higher than 4.0 Place this code into your build.gradle file

android {
compileSdkVersion 28
defaultConfig {
    applicationId 'com.example.myproject'
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 1
    versionName "1.0.0"
    ndk {
        debugSymbolLevel 'FULL'
    }
}
0
votes

Could not get unknown property 'android' for project ':app' of type org.gradle.api.Project.

You have to add it in gradle.properties not build.gradle

0
votes

I have the exact same issue.

Possible solutions:

  1. Use the Google classic Play console
  2. Gradle 4.1 is now released with Android Studio 4.1