Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7789549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:19:48+00:00 2026-06-01T21:19:48+00:00

I think I hit something rough… let me know your thoughts. I’ve been developing

  • 0

I think I hit something rough… let me know your thoughts.

I’ve been developing for while now an infra project for Android which uses Annotations, which I use to define a couple of things.

Take a look at the following annotation, it should compile, and it does, but when I run it on the device, I get a NoClassDefFoundException.

@Target({FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface ViewIdentifier {

    int viewId() default -1;

    int[] viewIds() default {};

    ViewUI_Action[] listeners() default {};

    boolean forDev() default false;

}

This is THE implementation:

@SuppressWarnings("unused")
@ViewIdentifier(
        listeners = ViewUI_Action.OnClickAsCollection,
        viewIds = {R.id.AccelerometerEngineeringScreen, R.id.RotationVectorEngineeringScreen, R.id.NetworkEngineeringScreen,
                R.id.MagneticEngineeringScreen, R.id.OrientationEngineeringScreen, R.id.GPS_EngineeringScreen, R.id.CallsEngineeringScreen,
                R.id.UpgradeAppButton, R.id.DEV_Action_Button, R.id.FYI_Button})
private View[] modelViews; 

If I remove the ViewIdentifier Annotation, the code compiles, and runs fine, the app starts, but if I return the annotation, the NoClassDefFoundError persists.

This is NOT a clean build issue, I’ve been very careful before posting this, plus, The missing class file is in the bin/classes, and it does work regardless of clean build when I remove the annotation. I’ve tried refreshing the workspace rebuilding it, close-open project, restart Eclipse, and other tricks.

The weirdest thing is that if I reverse the parameter of the annotation eg.

@SuppressWarnings("unused")
@ViewIdentifier(
        viewIds = {R.id.AccelerometerEngineeringScreen, R.id.RotationVectorEngineeringScreen, R.id.NetworkEngineeringScreen,
                R.id.MagneticEngineeringScreen, R.id.OrientationEngineeringScreen, R.id.GPS_EngineeringScreen, R.id.CallsEngineeringScreen,
                R.id.UpgradeAppButton, R.id.DEV_Action_Button, R.id.FYI_Button},
        listeners = ViewUI_Action.OnClickAsCollection)
private View[] modelViews; 

I get an Eclipse error saying:

enter image description here

And Eclipse cannot locate the class containing this field.

So what do you think? Error compiling the class?

Adam.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:19:50+00:00Added an answer on June 1, 2026 at 9:19 pm

    It seems like the listeners field have array initializer syntax even for an array of size one.

    Hope that helps 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, I've been working on something for a while now, using reflection to accomplish
I don't know if I am doing something wrong I think I am or
I would like to know how long it's been since the user last hit
I think I'll have to hit myself in the head after that. Let's say
Used to know this, think its something like Ctrl + ??? + F11 .
Think about the following: Your ISP offers you a dynamic ip-address (for example 123.123.123.123).
I think know how to do this in C# but I'm having syntax trouble
I think I already know the answer to this but thought I would ask
I have hit a bit of a wall with some debugging. I have been
I've been trying think of a way to do this. I want it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.