Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Android ANR: NoClassDef when extending library classes #437

Open
klassm opened this issue Sep 11, 2014 · 0 comments
Open

Android ANR: NoClassDef when extending library classes #437

klassm opened this issue Sep 11, 2014 · 0 comments

Comments

@klassm
Copy link

klassm commented Sep 11, 2014

Hi there,

I have recently integrated Dagger into my app. When rolling out the new application version, some users complained about black startup screens. The Android developer tools told me that they where encountering ANRs. Up to then, I had no chance to reproduce that issue locally. However, afterwards I found one device encountering the same issue - at least once, so that I could see the log message.

What I was doing was something like

public class GCMIntentService extends GCMBaseIntentService {
    @Override
    public void onCreate() {
        super.onCreate();
        ((MyApplication) getApplication()).inject(this);
    }
}

Unfortunately I did not save the log message - but it told me that GCMBaseIntentService, stemming from Google, could not be found.

When changing the application to

MyApplication.getApplication().getGraph().get(MyBean.class);

my users where happy again.

This is a somewhat strange bug which is really hard to find.

Matthias

tbroyer pushed a commit to tbroyer/dagger that referenced this issue Sep 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant