Android MultiDex: an all time salvation is imperative

前端 未结 1 1998
广开言路
广开言路 2020-12-04 03:04

This question is the aftermath of a four day long and painful journey of consecutive attempts to overcome a appDebugAssemble failed build. I\'ve read a super considerable am

相关标签:
1条回答
  • 2020-12-04 03:45

    Ok, I guess I could endure a little longer with my research, but I almost felt hopeless. I finally managed to resolve the issue, so I'm posting it for future reference nevertheless, since I realize there's a lot of us who actually struggle with enabling MultiDexing in our apps.

    My actual problem was duplicate versions of Google Play Service libraries. I'm using Facebook Audience Network SDK and it relies on com.google.android.gms:play-services-ads:10.0.4, whilst my Firebase implementation depends on 11.2.2.

    The thing is that unless you remind yourself to look in detail for what dependencies your libraries depend on, you really have no way to figure this out because just like @AlexLipov said above "the error log is too generic". My bulb lightened up from this comment on GitHub.

    To conclude, basically follow the official MultiDex guide, then if similar problem pop up, give a peak to identify potential dependency conflicts and then do the following to force them use the recent version accordingly.

    implementation('com.facebook.android:audience-network-sdk:4.25.0') {
        exclude group: 'com.google.android.gms'
    }
    

    A final note worthy of mention, running gradle --stacktrace helps narrow down problems quite a bit. This might come in handy too.

    P.S. Thanks and Alex for chiming in.

    0 讨论(0)
提交回复
热议问题