Search code examples
androidfirebasefirebase-analytics

Android - Firebase analytics not showing on dashboard after enabling minifyEnabled & shrinkResources


I have enabled minifyEnabled & shrinkResources in my code. After enabling I am not getting any analytics of that app version on Analytics dashboard.

Do I need to make any proguard changes for firebase analytics?

build.gradle

buildTypes {
        debug {
            
        }
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            firebaseCrashlytics {
                mappingFileUploadEnabled true
            }
        }
    }

Solution

  • First of all, try to add this to your proguard

    -keep class com.google.analytics.** { *; }
    

    Did you use any custom class for the source of the value you send? If yes then you should be adding that class to proguard as well