Closed null1099 closed 7 years ago
Hi, it looks like you do not have a default constructor in you presenter :) (It is something said by the exception)
Ups, sorry. Now I did read it till the end. Did you try to completely clean/rebuild you project?
Hi, clean/rebuild has no effect, still getting the exception.
@null1099 Do you have proguard, or some APT tool in the build chain? Try adding this to your activity class to see what the runtime sees:
static {
try {
Log.d("MyPresenter", "Constructors:");
for (Constructor<?> constructor : MyPresenter.class.getDeclaredConstructors()) {
Log.d("MyPresenter", constructor.toString());
}
} catch(Throwable t) {
Log.e("MyPresenter", "Error enumerating constructors", t);
}
}
(it needs to be in the activity because the presenter class is not initialized until first access, which would be inside a successful newInstance
after the sanity checks are done)
I noticed that null is using Android 23 or 24 (because newInstance
became native on those platforms).
I tried an empty project with just these two classes and the only time I got the same exception is when I added a constructor with argument(s). I tried a lot of other things, like failed static initializer, visibility, abstract, but all of them gave a different error message.
I have the two following classes (simplified):
MyActivity.java:
MyPresenter.java:
when launching MyActivity, I get the following RunTimeException:
This doesn't change even when I add the required zero argument constructor to MyPresenter (besides, I've never seen this in the examples). Is there anything I missing?
This happens for Nucleus v3.0.1 as well as v4.0.0