I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors.... Any one have some hint..?
ERROR from LogCat:<
For me it was different from any of the above,
The activity was declared as abstract, That is why giving the error. Once it removed it worked.
Earlier
public abstract class SampleActivity extends AppcompatActivity{
}
After removal
public class SampleActivity extends AppcompatActivity{
}
There is another way to get an java.lang.RuntimeException: Unable to instantiate activity ComponentInfo exception and that is the activity that you are trying to start is abstract. I made this stupid mistake once and its very easy to overlook.
Another reason of this problem may be a missing library.
Go to Properties -> Android and check that you add the libraries correctly
It also happens because of this issue. I unchecked the jars that needed be exported to the apk and this same thing happened. Please tick the jars that your app Needs to run.
Your New Activity add AndroidManifest.xml
like ".NewActivity"
</activity>
<activity android:name=".NewActivity" />
In my case I forgot to add the google maps library
<application>
....
<uses-library android:name="com.google.android.maps" />
</application>
Also, check that you're not missing the preceding dot before the activity path
<activity android:name=".activities.MainActivity"/>