Daniel
Daniel

Reputation: 347

Problems with multi-dex

I'm using the Maven-Android-Plugin to build my project which has a lot of dependencies and therefore I've to use the multi-dex option. This works using the methods described here. We'll kind of. In my project I'm havin multiple Services, each running in it's own process. So the dex-files are loaded multiple time.

And here comes the/my problem: Whoever starts up last (Service or Activity) crashs with an weird exception (if you're interested in I can post the logcat output). So my assumption is that the multiple loading fails because of file access to the optimzed dex-files, as my current workaround (adding the process-id to each directory for working/optimzed) let's me get beyond the crash.

Can anyone confirm this behavior or have a better workaround?

Logcat output can be found here. The "weird" errors start around line 800.

Upvotes: 1

Views: 439

Answers (2)

LukaszS
LukaszS

Reputation: 586

First of all I see here lots of DexOpt messages which is very strange. It looks like you are installing classes which are already bundled in Android. Second of all I see file path like app_optimized/classes2.dex/classes2.dex which is not good but probably works. It seems that dexes are loaded correctly by DexOpt so I would suggest to check those messages. I also not sure about loading same classes multiple times but did not check it.

Upvotes: 1

pixel
pixel

Reputation: 26493

It looks like dex files that were created are corrupt. Which version of android maven plugin are You using?

Upvotes: 0

Related Questions