Android Failed android build after update

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Warspite2, Oct 6, 2018.

  1. Warspite2

    Warspite2 Member

    Joined:
    Jun 23, 2016
    Posts:
    80
    I tried compiling one of my games that desperately needs an update, the build fails and this is what I get...

    Execution failed for task ':com.NewHopeGames.artilleryfire:transformClassesWithJarMergingForDebug'.
    > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/ConnectionClosedException.class

    I tried a clean and a new save of the game and still get same error. I also deleted all extensions and re-downloaded them. Last I created a totally blank game with just 1 object and a few sprites. Still same error so this is not a problem with my game. My compiler was working fine before this last gms2 update. Anyone have an idea of what I can do? Is it possible to uninstall and reinstall the previous gms2 version? Any help greatly appreciated.
     
  2. Pano

    Pano Member

    Joined:
    Dec 14, 2016
    Posts:
    76
    use previous runtime, not the last one
     
  3. Warspite2

    Warspite2 Member

    Joined:
    Jun 23, 2016
    Posts:
    80
    Come to find out, it was the GooglePlayServicesExtension. After updating gms2, I seen a notification on the marketplace indicating I needed to update the extension so I did. After updating I opened that extension and it showed v2.9.0. So mysteriously my older game compiled fine then I checked the services extension in that game and it showed v3.0.1. So i deleted and redownloaded the extension from marketplace and what did I get 2.9.0! Then I tried again, and it was version 2.9.0 again. So I tried my famous 'blank game' method and got same thing after clean download of the extension.

    Last I finally imported the 3.0.1 extension from my older game that compiled fine. So it looks like somehow the old 2.9.0 services extension replaced the 3.0.1 on the marketplace. No one can download 3.0.1 on marketplace because what is up there is 2.9.0 and it breaks the compiler. Make a blank game, download that extension and see 2.9.0 then watch one failed build after another. I made sure to download the extension for gms2 directly from marketplace. Anyway I sure hope this helps others because it took me hours of testing to figure out what was going on here.
     
    Last edited: Oct 7, 2018
  4. Winter Drake

    Winter Drake Member

    Joined:
    Oct 20, 2018
    Posts:
    1
    I've run into the same problem, and it looks like the google play services extension downgraded to 2.9.0 automatically. However, the only file I can get directly from the marketplace is a "yymp" file, which I can't find any way to import into GMS2. "Add Existing" extension requires you to choose a .YY file, and "import extension" requires a .GMEZ file. How did you manage to get the 3.0.1 version of the google play services??

    ------------------------------

    Edit, I think i figured it out, but the file I directly downloaded from the marketplace is also 2.9.0. I contacted the people who made the extension about the downgrade, it's very frustrating. If anyone has a copy of 3.0.1 please send it to me. I'm losing money because of my inability to update my app.
     
    Last edited: Oct 20, 2018
  5. sman

    sman Member

    Joined:
    Jun 28, 2016
    Posts:
    107
    I've the same problem with transformClassesWithJarMergingForDebug but it's not fixed with an old runtime (even the May 17 runtime). So it's not a runtime issue because my game was working fine at that time. So where does this problem come from?
    I've still the 2.9.0 version of the google play services extension and I don't want to update it. It was working fine. Is there any solution?
     
  6. Trasoside

    Trasoside Member

    Joined:
    Jun 25, 2016
    Posts:
    26
    Just wanted to update this post because I've been suffering from this error for days...
    I had the exact same error as @Warspite2 :
    Execution failed for task ':com.NewHopeGames.artilleryfire:transformClassesWithJarMergingForDebug'.
    > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/ConnectionClosedException.class

    the problem was, because I used the extensions:
    GooglePlayServicesExtension
    together with
    GooglePlayLicensingAsExt and PlayAPKExpansionExtension
    using GooglePlayServicesExtension alone worked fine.
    using GooglePlayLicensingAsExt and PlayAPKExpansionExtension alone worked fine.

    GooglePlayServicesExtension gradle:
    Code:
       compile 'com.google.android.gms:play-services-games:11.8.0'
       compile 'com.google.android.gms:play-services-ads:11.8.0'
       compile 'com.google.android.gms:play-services-plus:11.8.0'
       compile 'com.google.android.gms:play-services-gcm:11.8.0'
       compile 'com.google.android.gms:play-services-auth:11.8.0'
       compile 'com.google.android.ads.consent:consent-library:1.0.3'
     compile fileTree(dir: 'libs', include: ['*.jar'])
    
    GooglePlayLicensingAsExt gradle:
    Code:
     compile 'org.jbundle.util.osgi.wrapped:eek:rg.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    PlayAPKExpansionExtension gradle:
    Code:
    compile 'org.jbundle.util.osgi.wrapped:eek:rg.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile project(':library')
    now after tons of attempts, I figured out the following conclusions (anyone, feel free to correct me):
    PlayAPKExpansionExtension uses compile project(':library') which probably compiles org.apache.http.legacy.jar once.
    then, GooglePlayServicesExtension uses compile fileTree(dir: 'libs', include: ['*.jar']) to compile all .jar files, so that org.apache.http.legacy.jar is probably trying to compile again there.

    so what I did was changing GooglePlayServicesExtension gradle to:
    Code:
       compile 'com.google.android.gms:play-services-games:11.8.0'
       compile 'com.google.android.gms:play-services-ads:11.8.0'
       compile 'com.google.android.gms:play-services-plus:11.8.0'
       compile 'com.google.android.gms:play-services-gcm:11.8.0'
       compile 'com.google.android.gms:play-services-auth:11.8.0'
       compile 'com.google.android.ads.consent:consent-library:1.0.3'
    
    *yeah i removed the compile fileTree(dir: 'libs', include: ['*.jar']) thing and it worked.
    *btw, changing it to compile fileTree(dir: 'libs', include: ['*.jar'], exclude: 'org.apache.http.legacy.jar') also worked.

    that, solved the duplicate problem, and everything worked fine.

    hope it could help anyone else, I almost gave up on this.

    I used
    runtime : v2.2.0.261
    IDE : v2.2.0.343
    android build tools/support library/target sdk/minimum sdk/compile sdk :
    28.0.0/28.0.0/28/14/28
    also, after updating to v2.2.0.261, I removed all google extensions I used and re-added them (I believe it did solve some problems)
     
    Last edited: Dec 1, 2018
    Justice likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice