Custom global Application class breaks with “android.app.Application cannot be cast to”

The error states that the type of the object returned by getApplication is android.app.Application. A possible cause for this is that you failed to define the application in the manifest. Make sure that your manifest includes something in the lines of:

<application android:name=".MyApp"...
</application>

Leave a Comment