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:<
I had the same problem, but I had my activity declared in the Manifest file, with the correct name.
My problem was that I didn't have to imported a third party libraries in a "libs" folder, and I needed reference them in my proyect (Right-click, properties, Java Build Path, Libraries, Add Jar...).
This error also occurs when you use of ActionBarActivity
but assigned a non AppCompat
style.
To fix this just set your apps style parent to an Theme.AppCompat
one like this.:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<!-- Customize your theme here. -->
</style>
In my case, I was trying to embed the Facebook SDK and I was having the wrong Application ID; thus the error was popping up. In your manifest file, you should have the proper meta data:
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
In my case, I was trying to initialize the components(UI) even before the onCreate
is called for the Activity.
Make sure your UI components are initialized/linked in the onCreate
method after setContentView
NB: This is my first mistake while learning Android programming.
This happened to me when I tried to run an Activity
on 2.2 that used imports from Honeycomb not available in older versions of Android and not included in the v4 support package either.
In my case I haven't set the setContentView(R.layout.main);
If you create a new class do not foget to set this in on onCreate(Bundle savedInstanceState)
method.
I have done this stupid mistake several times.