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.

Android 2.3: Classes generated with @EActivity don't contain method getDeclaredMethods()  #747

Copy link
Copy link
@AnnKrajnik

Description

@AnnKrajnik
Issue body actions

I use Android Studio and Gradle to build my project, version of annotations - 3.0-SNAPSHOT. When I try to call method getDeclaredMethods() for my activity's class then it throw NoSuchMethod exception on devices(and emulators) with Android 2.3.x. On devices with 4.0 and later all work good.
Code sample:

@EActivity(R.layout.activity_test)
public class CompanyActivity extends NavigationActivity{
...
@AfterViews
void init(){
Method[] ms = this.getClass().getDeclaredMethods();
   ...
}
}

Error stack trace:
Caused by: java.lang.NoSuchMethodException
at java.lang.Class.getDeclaredMethods(Native Method)
at java.lang.ClassCache.getDeclaredMethods(ClassCache.java:140)
at java.lang.Class.getDeclaredMethods(Class.java:757)
at my.app.test.activity.TestActivity.init(TestActivity.java:25)
at my.app.test.activity.TestActivity_.onViewChanged(TestActivity_.java:43)

When I call this method for another generated classes - for example, generated with @efragment or with @eviewgroup - app doesn't crash.

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

    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.