I’m trying to create define a custom Application class as follows:
- create an empty subclass of
Application called MyApp - in the manifest, specify
android::name for my application:
<application android:name=".MyApp"
...
However, when I attempt to run my app, I get:
java.lang.RuntimeException: Unable to instantiate application com.test.MyApp java.lang.IllegalAccessException: access to class not allowed
Make sure your custom class is
public, has apubliczero-argument constructor, and that the constructor chains to the superclass’ constructor.