1.java.lang.illegalaccessexception:access to class not allowed
Reason: No class is set to public when writing class file
2.java.lang.runtimeexception:unable to instantiate activity ComponentInfo
Reason:
There are three scenarios in which activity cannot be instantiated:
A. The activity is not registered in the manifest.xml manifest, or the class name of the package name or activity is modified after the activity has been created, and the configuration manifest is not modified, resulting in an instantiation.
B. Create a new package yourself, and the default package is still used when registering, for example, the default package is the Com.ghg.Dao package, you create a new Com.ghg.DaoImpl package, and write a firstactivity in this package, when you register in Manifest.xml you write <activity android:name= ". Firstactivity "/>, at this time the equivalent of your class registered to the default package, the system is not found in the default package, because your firstactivity under the Com.ghg.DaoImpl package, so you should register as a package name plus class name, such as:< Activity android:name= "com.ghg.DaoImpl.FirstActivity" so that the system can find the corresponding class in the specified package.
C. Also use one is that your firstactivity is defined as an abstract class, which seems like the average person does not commit.
D. Just can't access, don't set that class to public
Android Runtime exception analysis (continuous update)