I am trying to build a signed apk for my app but am getting this error whenever I try to build it:

Can't find common super class of [com/google/android/gms/internal/zzata] (with 1 known super classes) and [java/lang/String] (with 2 known super classes)

I was able to build signed apk's using different keystores before just fine but now all I get is this error.

2 Answers

0
shizhen On Best Solutions

It looks like a proguard setting problem, see: Warning: can't find superclass or interface.

If the missing class is referenced from your own code, you may have forgotten to specify an essential library. Just like when compiling all code from scratch, you must specify all libraries that the code is referencing, directly or indirectly. If the library should be processed and included in the output, you should specify it with -injars, otherwise you should specify it with -libraryjars.

0
PaPaB1nG0 On

Looks like I found what the issue was. In my build gradle for the app, I had my dependencies listed like this:

dependencies {
        implementation fileTree(include: ['*.jar'], dir: 'libs')
        implementation project(':libcocos2dx')

    }
    //dependencies { compile 'com.google.android.gms:play-services-ads:15.0.1' }
    dependencies { compile 'com.google.android.gms:play-services-analytics:12.0.1' }
    dependencies { compile 'com.google.android.gms:play-services-auth:15.0.0' }
    dependencies { compile 'com.google.android.gms:play-services-games:15.0.0' }
    dependencies { compile 'com.google.android.gms:play-services-drive:15.0.0' }

The error that I was getting above was saying that a library reference could not be found in the google gms namespace. it turns out it was because of the versions I was using for the 'com.google.android.gms:play-services-analytics:12.0.1' service. I just changed the version from 12.0.1 to 15.0.0 like the rest of the libraries and it then worked and generated my signed APK. Thank you to all that helped and I hope this can help anyone who has the same issue.