larpon / QtFirebase

An effort to bring Google's Firebase C++ API to Qt + QML
MIT License
284 stars 83 forks source link

Error merging dex archives #117

Closed daljit97 closed 5 years ago

daljit97 commented 5 years ago

So I changed my build.gradle file to reflect the QtFirebaseExample (I literally just copied it and changed the package name), but I am getting this strange errors in my project when I compile it:

What went wrong: Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
BUILD FAILED in 8s 21 actionable tasks: 8 executed, 13 up-to-date com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:

I also tried to add implementation 'com.android.support:multidex:1.0.3' but the error still persists. I am not really sure what is causing this.

I am using:

larpon commented 5 years ago

Can you provide version info for the following:

The project builds fine on my Linux host machine with Qt 5.12.4

Also try disabling multidexing completely

daljit97 commented 5 years ago

yeah sorry I updated my post.

daljit97 commented 5 years ago

Ok so after long hours of trial error I managed to successfully compile the app (other problems arose however which I think don't have much to do with QtFirebase). So what I did was migrate my project to AndroidX as suggested here https://developer.android.com/jetpack/androidx/migrate. After doing that my project magically compiles without errors. I am not sure why this is the case though (maybe because I am building for a higher version of android APIs???)

larpon commented 5 years ago

@daljit97 - thanks for reporting back! The Higher API targets could be the problem - but I'm just guessing here.

I'm glad to hear you got it working. One of the problems, in general, with QtFirebase is that it rely on such a large stack of different languages, build tools and technologies (C++, Objective-C, GCC, clang, Qt, QML, Firebase C++ SDK, Android SDK/NDK, Gradle, iOS, MacOSX, XCode etc. ...) - and as everyone know: software doesn't always work as it should :smile: So there's so many details, nooks and cringes to account for.

If you came across something you think could be made easier in regard to QtFirebase - please feel free to submit a pull-request :+1: