Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

NPE when AA injects into a non-generated class #1207

Copy link
Copy link
@WonderCsabo

Description

@WonderCsabo
Issue body actions

Steps to reproduce:

  1. Create an Activity, annotate with @EActivity
  2. Create MyPref interface, annotate with @SharedPref
  3. Inject MyPref_ mypref field into the Activity with @Pref
  4. Make sure not the generated class is in the manifest.

After that, AA will crash with NPE in the PrefHandler. This is because we do not generate the class, instead we print an error about wrong component name in the manifest. But the PrefHandler still runs, and thinks the generated class holder exists...

Stacktrace:

java.lang.NullPointerException
    at org.androidannotations.handler.PrefHandler.process(PrefHandler.java:75)
    at org.androidannotations.handler.PrefHandler.process(PrefHandler.java:36)
    at org.androidannotations.process.ModelProcessor.processThrowing(ModelProcessor.java:145)
    at org.androidannotations.process.ModelProcessor.process(ModelProcessor.java:129)
    at org.androidannotations.AndroidAnnotationProcessor.processAnnotations(AndroidAnnotationProcessor.java:242)
    at org.androidannotations.AndroidAnnotationProcessor.processThrowing(AndroidAnnotationProcessor.java:184)
    at org.androidannotations.AndroidAnnotationProcessor.process(AndroidAnnotationProcessor.java:112)

Example project demonstrating the issue. The issue can be reproduced both from command line and Eclipse.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.