Updated Android Studio Will Not Build - 2 Weird Errors...

Discussion in 'Technical Discussion' started by J.E.Moores, Mar 11, 2020.

  1. J.E.Moores

    J.E.Moores Boxer

    Joined:
    Feb 5, 2019
    Messages:
    16
    Likes Received:
    4
    March 11, 2020: All my BuildBox v 2.3.8 B#2520 games are getting these two issues when creating a build using the latest update to Android Studio v 3.6.1
    _______________
    ERROR: This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.
    I added this into gradle.properties to get past this warning:

    android.useAndroidX=true

    and it works! (or so I thought - but this could be the cause of the next problem?)
    _______________
    Then when I attempt to build an AAB, I get another warning:
    More than one file was found with OS independent path 'androidsupportmultidexversion.txt'
    I found the problem, but can't fix it. I can see two of the same files by using Packages View in Android Studio. It looks like this:
    androidsupportmultidexversion.txt
    androidsupportmultidexversion.txt
    duplicate-warning.jpg
    I've tried many things, could not figure out a work around.
    I cannot safe delete one so I tried variations of:
    packagingOptions {
    exclude '...???'
    }
    and then my brain melted. My melted brain could barely put all this together to share this issue with you all. You see, I could successfully build AAB files before I updated Android Studio without having to do any coding. Anyone else having these issues or am I a doufus? Maybe both? Thanks in advance just for being you. Stay warm and be cool. ~Jay.
     
  2. Sean Buildbox

    Sean Buildbox Serious Boxer

    Joined:
    Sep 24, 2015
    Messages:
    902
    Likes Received:
    1,076
    Hi Jay,

    One of our engineers looked into this. He says:

    - To try and reproduce the issue I upgraded my older Android Studio to 3.6.1. It had a minor issues with the NDK not updating correctly so I manually installed the latest from Google.

    - I used Buildbox 2.3.8 B#2520 to build an AAB out of the sample game. Android Studio gave me another NDK error about needing NDK 20.0.5594570. I installed that, did a "Sync project with Gradle Files", and after that the AAB built with no problems. I didn't need to mess with any AndroidX settings.

    - Are you using any additional ad libraries or plugins?

    - If you want to you can email a Dropbox or Google Drive link to a ZIP of your Android Studio project to support@buildbox.com, mention it's "for Abe", and I'll try compiling it on my Android Studio install.
     
  3. J.E.Moores

    J.E.Moores Boxer

    Joined:
    Feb 5, 2019
    Messages:
    16
    Likes Received:
    4
    Sooooo... if I do NOT upgrade the Gradle inside Android Studio it works! Usually when ever I open my buildbox file in Android Studio there is a pop up so I can upgrade Gradle, so I upgrade to the latest Gradle. However the last couple days I get several warnings and cannot complete the build. Through trial and error I have discovered that if I do not upgrade the Gradle, I can complete the build for publishing onto Google Play. (woo-hoo!)

    I do have reward video custom code for AdMob that I put in my games, but I tried this process with and without that code and it was the update to Gradle within Android Studio that is causing this issue for me:

    More than one file was found with OS independent path 'androidsupportmultidexversion.txt'

    I guess Gradle is the "elephant in the room". Not sure why the update is not compatible with any of my games I have already published successfully. I swear the entire process changes each time I publish or update a game, lol. I was blown away by your fast response. Thanks.
     
    Sean Buildbox likes this.
  4. godofnet

    godofnet Boxer

    Joined:
    Jun 10, 2020
    Messages:
    17
    Likes Received:
    1
    Hello,
    I have the same problem and i think its affecting the admob ads cause is not showing event with the Sample ad units?
    Any idea about this!
     

Share This Page