2

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Charlie Ansell
  • 451
  • 1
  • 7
  • 22
  • How is your proguard settings for release apk? – shizhen Mar 27 '19 at 01:52
  • I can post the proguard file with its settings if that's what you're looking for. earlier on today it was working until i changed the keystore because i forgot passwords, its weird – Charlie Ansell Mar 27 '19 at 01:54
  • Try to remove `-dontwarn` from your proguard settings which suppress warnings about unresolved references, so that you can get more detailed error / warning logs. – shizhen Mar 27 '19 at 02:00
  • okay, ill do that now and post results. I am using a cocos 2dx project if that would make any difference, it's just it was generating an apk earlier and nothing has changed since apart from a different keystore – Charlie Ansell Mar 27 '19 at 02:04
  • check here to see if it helps: https://stackoverflow.com/a/50622234/8034839 – shizhen Mar 27 '19 at 02:09
  • I was on that thread earlier, I tried adding the play services ads but that didn't work, unfortunately. I am still waiting for this to build it takes forever. i should get a more detailed issue and will report back when i have gotten it – Charlie Ansell Mar 27 '19 at 02:14
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/190736/discussion-between-papab1ng0-and-shizhen). – Charlie Ansell Mar 27 '19 at 02:28
  • https://stackoverflow.com/questions/55415211/how-to-fix-gradle-error-in-google-open-source-launcher3-when-running-git-code-in please help – newbie pete Mar 29 '19 at 10:22

2 Answers2

0

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.

shizhen
  • 12,251
  • 9
  • 52
  • 88
0

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.

Charlie Ansell
  • 451
  • 1
  • 7
  • 22
  • You can consolidate your dependencies into one single `dependencies { }` and change all the `compile` to `implementation` for newer gradle plugin version. – shizhen Mar 27 '19 at 04:40