Fix “Multiple dex files define L…” Errors

Posted by in Software

Today I got an error when building the APK: Multiple dex files define L/… My scenario is that of a project with 2 modules: a core and an app. Both modules use a plugin named androiddevmetrics, which generate some code, including a class which has the same signature in both modules. The linking (APK generation) resulted in an obvious conflict. My steps to solve this error are: Identify which package/module generates the error. The L/com/android/… will tell you exactly who the culpable is. In my case, the idea is to…read more


Posted by in Software

Today I got the lovely UNEXPECTED TOP-LEVEL EXCEPTION from the dexer in android. Looking on the net yielded several causes and resolutions. Note: I’m using Gradle 2.10, Android Studio 2.0.0-beta2 Caching Apparently, sometimes Gradle is shooting itself in the foot with the caching. The first thing you can do is to clean your project. Remove all build directories, all Gradle caches and rebuild. Some references: UNEXPECTED TOP-LEVEL EXCEPTION: Duplicate inclusion It looks like this is the most common reason for such error. >Duplicate inclusion can occur when your app…read more

Butterknife: ClassCastException: Symbol$VarSymbol …

Posted by in Software

The other day I decided to update my Butterknife from 6.x.x to 7.x.x. Immediately I noticed some refactoring (e.g. @InjectView became @Bind). I updated my code and got build (from Android Studio’s “make”). Unfortunately, when I tried to test it, I got: java.lang.ClassCastException:$VarSymbol cannot be cast to javax.lang.model.element.ExecutableElement from Dagger (yes, I’m still using 1.x.x). Annoying to say the least. Solution It turns out that I forgot to refactor a couple of files from my code and Dagger failed to parse dome Butterknife code (I guess?). My solution was…read more

Synology and “Sparsebundle is Already in Use” Error

Posted by in Hardware, Software

Today one of my Sinology drives failed. When I’ve replaced it, I got an error from my Mac’s Time Machine about a “sparsebundle is already in use“. I saw a discussion saying the solution was to close/reopen TM connection. With Synology, I only needed to disable and enable the service off the Control Panel: Just click on the “Enable Mac file service” to disable and re-enable it. Of course, you need to press Apply after each operation, so the command is actually performed :) A little experiment: If you find…read more

Attempted to Finish an Input Event …

Posted by in Software

… but input event receiver has already been disposed. This is the error I got while trying to do something off a menu in Android. Silly really. The message is not too revealing so I ended up scouring the net for an answer and scratching my head afterwards… With a service My problem was trying to launch a service; I figured it out with a single step: Disable the filter in Android Studio (logcat). Then, just before this message, I got another one:

which gave me the real reason:…read more