Getting Fatal Exception with Tabs in Android application - android

I am getting Fatal Exception while running the application and in Emulator it gives "Force Close".
Here is the LogCat content,
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): FATAL EXCEPTION: main
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.demotab/com.demotab.DemotabActivity}: java.lang.IllegalStateException: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.os.Looper.loop(Looper.java:123)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at java.lang.reflect.Method.invoke(Method.java:521)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at dalvik.system.NativeStart.main(Native Method)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): Caused by: java.lang.IllegalStateException: Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:649)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.widget.TabHost.setCurrentTab(TabHost.java:323)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.widget.TabHost.addTab(TabHost.java:213)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at com.demotab.DemotabActivity.onCreate(DemotabActivity.java:36)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-28 22:01:14.567: ERROR/AndroidRuntime(11421): ... 11 more
Please guide me how can I resolve it.

Got the solution,
extended my class with ActivityGroup instead of Activity and added
tabHost.setup(this.getLocalActivityManager());

Related

Cocos2d-x game built with Android API 21 is not working on lower API versions

I have built cocos2d-x game using Android API 21 but it is not working on lower API version, game crashes on startup. These are the logs:
07-28 22:09:47.358: E/dalvikvm(6483): dlopen("/data/app-lib/com.pld.readingrace1a-1/libcocos2dcpp.so") failed: Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "rand" referenced by "libcocos2dcpp.so"...
07-28 22:09:47.366: E/AndroidRuntime(6483): FATAL EXCEPTION: main
07-28 22:09:47.366: E/AndroidRuntime(6483): java.lang.ExceptionInInitializerError
07-28 22:09:47.366: E/AndroidRuntime(6483): at java.lang.Class.newInstanceImpl(Native Method)
07-28 22:09:47.366: E/AndroidRuntime(6483): at java.lang.Class.newInstance(Class.java:1319)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.os.Looper.loop(Looper.java:137)
07-28 22:09:47.366: E/AndroidRuntime(6483): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-28 22:09:47.366: E/AndroidRuntime(6483): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 22:09:47.366: E/AndroidRuntime(6483): at java.lang.reflect.Method.invoke(Method.java:511)
07-28 22:09:47.366: E/AndroidRuntime(6483): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-28 22:09:47.366: E/AndroidRuntime(6483): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-28 22:09:47.366: E/AndroidRuntime(6483): at java.lang.Runtime.loadLibrary(Runtime.java:371)
07-28 22:09:47.366: E/AndroidRuntime(6483): at java.lang.System.loadLibrary(System.java:535)
07-28 22:09:47.366: E/AndroidRuntime(6483): at org.cocos2dx.cpp.AppActivity.<clinit>(AppActivity.java:272)
I have searched and found some answers on stack overflow like
this one
but I want to build my game on API 21 because I am using some new features and I want it to work on older API versions. Can someone help in this regard. Thanks.
Make sure you set your TARGET SDK to a lower version. You should still be able to access most of the API 21 features.

Android Game crashed at facebook login in Kitkat only

I have integrated facebook unity sdk v5.1.0 in my game I am also using Google playservices for leaderboard.
My game works great on all phone except on kit kat, Moto E, nexus 4, nexus 5. The strange thing is that sometimes it run. but most of the time it crashes
The catch is that I have released the same build with no issues and it was working fine even on kitkat.
But recently my eclipse crashed and I downloaded ADT bundle, it has on androidW SDK and L privew.
I know that something went wrong during the build phase.
So i uninstalled all the sdk and installled only 4.4.2(API level 19)
I am using Unity Ver 4.5.2f1
I have only 4.4.2 (API level 19) in my sdk manager
logs are
07-28 18:54:35.664: E/AndroidRuntime(14925): FATAL EXCEPTION: main
07-28 18:54:35.664: E/AndroidRuntime(14925): Process: com.itecno.cowboysvszombies, PID: 14925
07-28 18:54:35.664: E/AndroidRuntime(14925): java.lang.Error: FATAL EXCEPTION [main]
07-28 18:54:35.664: E/AndroidRuntime(14925): Unity version : 4.5.2f1
07-28 18:54:35.664: E/AndroidRuntime(14925): Device model : motorola XT1022
07-28 18:54:35.664: E/AndroidRuntime(14925): Device fingerprint: motorola/condor_retaildsds/condor_umtsds:4.4.4/KXC21.5-40/46:user/release-keys
07-28 18:54:35.664: E/AndroidRuntime(14925): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.itecno.cowboysvszombies/com.facebook.unity.FBUnityLoginActivity}: java.lang.NullPointerException
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2257)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.ActivityThread.access$800(ActivityThread.java:139)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.os.Handler.dispatchMessage(Handler.java:102)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.os.Looper.loop(Looper.java:136)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.ActivityThread.main(ActivityThread.java:5086)
07-28 18:54:35.664: E/AndroidRuntime(14925): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 18:54:35.664: E/AndroidRuntime(14925): at java.lang.reflect.Method.invoke(Method.java:515)
07-28 18:54:35.664: E/AndroidRuntime(14925): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
07-28 18:54:35.664: E/AndroidRuntime(14925): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
07-28 18:54:35.664: E/AndroidRuntime(14925): at dalvik.system.NativeStart.main(Native Method)
07-28 18:54:35.664: E/AndroidRuntime(14925): Caused by: java.lang.NullPointerException
07-28 18:54:35.664: E/AndroidRuntime(14925): at com.facebook.unity.FBUnityLoginActivity.onCreate(FBUnityLoginActivity.java:17)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.Activity.performCreate(Activity.java:5248)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
07-28 18:54:35.664: E/AndroidRuntime(14925): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
Great help if someone can point me in the right direction.
Actually the issue was that i was switching from one scene to another before the call was complete.
And also there are also some clashes with sdk that I am using for ads and analytics
I m using 5 sdk so there were some clashes ....
sorry for bothering u guys and Facebook support too...where I have filed a bug in the SDK...he he

Android Concurrency Collections

i am working on an app that has running many async tasks that bring data from server and approx 20 async task are running at a time and there are some threads which validate the data simulatenously.
I have made data models which update my Collections in which data is being stored.
The structure to save data resides on Hashmap that contains an arraylist
So my Question is
Is Android Context ThreadSafe
Are Hashmaps in android ThreadSafe
I am using a Handler to Communicate messages so in this case Handler has a Message Queue is that threadsafe.
because sometimes one out of 10 times my app crashes giving
this is just one logcat in this case it happens while iterating, there are cases in which one task is reading hashmap and other is updating it this is the case in which mostly app crashes.
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): FATAL EXCEPTION: main
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): java.util.ConcurrentModificationException
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at com.Juggle2.Panel.onTouchEvent(Panel.java:823)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.view.View.dispatchTouchEvent(View.java:3766)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:863)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1767)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1119)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.app.Activity.dispatchTouchEvent(Activity.java:2086)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1751)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.os.Looper.loop(Looper.java:123)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at java.lang.reflect.Method.invokeNative(Native Method)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at java.lang.reflect.Method.invoke(Method.java:521)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:651)
07-28 15:36:59.815: ERROR/AndroidRuntime(4026): at dalvik.system.NativeStart.main(Native Method)
which is clear indication that when async tasks and threads are trying to update arrayList / hashmaps they give this concurrency exception.
Array Lists and Hashmaps are not thread safe. I would suggest using mutex / synchronized blocks to ensure that only one thread is reading / writing to your collections at a time. Here is a small example to get you started.
public class SomeClass {
private final Object mutex = new Object();
public void someMethodThatNeedsAMutex() {
synchronized(mutex) {
//here you hold the mutex
}
}
}

Android First Application tutorial

I have created a app based on the android tutorial : http://developer.android.com/training/basics/firstapp/index.html
The code is exactly the same except the app name but the application is force closing.
06-24 16:19:22.279: E/Zygote(33): setreuid() failed. errno: 2
06-24 16:19:33.028: E/Zygote(33): setreuid() failed. errno: 17
06-24 16:19:34.568: E/BatteryService(62): usbOnlinePath not found
06-24 16:19:34.568: E/BatteryService(62): batteryVoltagePath not found
06-24 16:19:34.568: E/BatteryService(62): batteryTemperaturePath not found
06-24 16:19:34.588: E/SurfaceFlinger(62): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
06-24 16:19:34.698: E/SensorService(62): couldn't open device for module sensors (Invalid argument)
06-24 16:19:39.449: E/System(62): Failure starting core service
06-24 16:19:39.449: E/System(62): java.lang.SecurityException
06-24 16:19:39.449: E/System(62): at android.os.BinderProxy.transact(Native Method)
06-24 16:19:39.449: E/System(62): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
06-24 16:19:39.449: E/System(62): at android.os.ServiceManager.addService(ServiceManager.java:72)
06-24 16:19:39.449: E/System(62): at com.android.server.ServerThread.run(SystemServer.java:206)
06-24 16:19:39.479: E/EventHub(62): could not get driver version for /dev/input/mouse0, Not a typewriter
06-24 16:19:39.479: E/EventHub(62): could not get driver version for /dev/input/mice, Not a typewriter
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/Effect_Tick.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressStandard.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressSpacebar.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressDelete.ogg
06-24 16:19:39.808: E/SoundPool(62): error loading /system/media/audio/ui/KeypressReturn.ogg
06-24 16:19:39.828: E/UsbObserver(62): java.lang.NullPointerException
06-24 16:19:39.828: E/UsbObserver(62): at com.android.server.UsbObserver.init(UsbObserver.java:131)
06-24 16:19:39.828: E/UsbObserver(62): at com.android.server.UsbObserver.<init>(UsbObserver.java:65)
06-24 16:19:39.828: E/UsbObserver(62): at com.android.server.ServerThread.run(SystemServer.java:402)
06-24 16:19:40.429: E/ThrottleService(62): Could not open GPS configuration file /etc/gps.conf
06-24 16:19:40.958: E/logwrapper(137): executing /system/bin/tc failed: No such file or directory
06-24 16:19:41.069: E/logwrapper(139): executing /system/bin/tc failed: No such file or directory
06-24 16:19:41.129: E/logwrapper(144): executing /system/bin/tc failed: No such file or directory
06-24 16:37:58.420: E/AndroidRuntime(345): FATAL EXCEPTION: main
06-24 16:37:58.420: E/AndroidRuntime(345): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View$1.onClick(View.java:2144)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View.performClick(View.java:2485)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.os.Looper.loop(Looper.java:123)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:37:58.420: E/AndroidRuntime(345): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:37:58.420: E/AndroidRuntime(345): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:37:58.420: E/AndroidRuntime(345): at dalvik.system.NativeStart.main(Native Method)
06-24 16:37:58.420: E/AndroidRuntime(345): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:37:58.420: E/AndroidRuntime(345): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.view.View$1.onClick(View.java:2139)
06-24 16:37:58.420: E/AndroidRuntime(345): ... 11 more
06-24 16:37:58.420: E/AndroidRuntime(345): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:37:58.420: E/AndroidRuntime(345): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:37:58.420: E/AndroidRuntime(345): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:37:58.420: E/AndroidRuntime(345): ... 14 more
06-24 16:38:47.529: E/AndroidRuntime(357): FATAL EXCEPTION: main
06-24 16:38:47.529: E/AndroidRuntime(357): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View$1.onClick(View.java:2144)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View.performClick(View.java:2485)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.os.Looper.loop(Looper.java:123)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:38:47.529: E/AndroidRuntime(357): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:38:47.529: E/AndroidRuntime(357): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:38:47.529: E/AndroidRuntime(357): at dalvik.system.NativeStart.main(Native Method)
06-24 16:38:47.529: E/AndroidRuntime(357): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:38:47.529: E/AndroidRuntime(357): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.view.View$1.onClick(View.java:2139)
06-24 16:38:47.529: E/AndroidRuntime(357): ... 11 more
06-24 16:38:47.529: E/AndroidRuntime(357): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:38:47.529: E/AndroidRuntime(357): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:38:47.529: E/AndroidRuntime(357): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:38:47.529: E/AndroidRuntime(357): ... 14 more
06-24 16:43:20.070: E/AndroidRuntime(385): FATAL EXCEPTION: main
06-24 16:43:20.070: E/AndroidRuntime(385): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View$1.onClick(View.java:2144)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View.performClick(View.java:2485)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.os.Looper.loop(Looper.java:123)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:43:20.070: E/AndroidRuntime(385): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:43:20.070: E/AndroidRuntime(385): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:43:20.070: E/AndroidRuntime(385): at dalvik.system.NativeStart.main(Native Method)
06-24 16:43:20.070: E/AndroidRuntime(385): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:43:20.070: E/AndroidRuntime(385): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.view.View$1.onClick(View.java:2139)
06-24 16:43:20.070: E/AndroidRuntime(385): ... 11 more
06-24 16:43:20.070: E/AndroidRuntime(385): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:43:20.070: E/AndroidRuntime(385): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:43:20.070: E/AndroidRuntime(385): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:43:20.070: E/AndroidRuntime(385): ... 14 more
06-24 16:45:09.099: E/AndroidRuntime(425): FATAL EXCEPTION: main
06-24 16:45:09.099: E/AndroidRuntime(425): java.lang.IllegalStateException: Could not execute method of the activity
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View$1.onClick(View.java:2144)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View.performClick(View.java:2485)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View$PerformClick.run(View.java:9080)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.os.Handler.handleCallback(Handler.java:587)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.os.Looper.loop(Looper.java:123)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:45:09.099: E/AndroidRuntime(425): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 16:45:09.099: E/AndroidRuntime(425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 16:45:09.099: E/AndroidRuntime(425): at dalvik.system.NativeStart.main(Native Method)
06-24 16:45:09.099: E/AndroidRuntime(425): Caused by: java.lang.reflect.InvocationTargetException
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 16:45:09.099: E/AndroidRuntime(425): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.view.View$1.onClick(View.java:2139)
06-24 16:45:09.099: E/AndroidRuntime(425): ... 11 more
06-24 16:45:09.099: E/AndroidRuntime(425): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 16:45:09.099: E/AndroidRuntime(425): at android.app.Activity.startActivity(Activity.java:2933)
06-24 16:45:09.099: E/AndroidRuntime(425): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 16:45:09.099: E/AndroidRuntime(425): ... 14 more
06-24 18:20:31.070: E/AndroidRuntime(464): FATAL EXCEPTION: main
06-24 18:20:31.070: E/AndroidRuntime(464): java.lang.IllegalStateException: Could not execute method of the activity
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View$1.onClick(View.java:2144)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View.performClick(View.java:2485)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View$PerformClick.run(View.java:9080)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.os.Handler.handleCallback(Handler.java:587)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.os.Looper.loop(Looper.java:123)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:20:31.070: E/AndroidRuntime(464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 18:20:31.070: E/AndroidRuntime(464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 18:20:31.070: E/AndroidRuntime(464): at dalvik.system.NativeStart.main(Native Method)
06-24 18:20:31.070: E/AndroidRuntime(464): Caused by: java.lang.reflect.InvocationTargetException
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:20:31.070: E/AndroidRuntime(464): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.view.View$1.onClick(View.java:2139)
06-24 18:20:31.070: E/AndroidRuntime(464): ... 11 more
06-24 18:20:31.070: E/AndroidRuntime(464): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 18:20:31.070: E/AndroidRuntime(464): at android.app.Activity.startActivity(Activity.java:2933)
06-24 18:20:31.070: E/AndroidRuntime(464): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 18:20:31.070: E/AndroidRuntime(464): ... 14 more
06-24 18:25:12.590: E/AndroidRuntime(477): FATAL EXCEPTION: main
06-24 18:25:12.590: E/AndroidRuntime(477): java.lang.IllegalStateException: Could not execute method of the activity
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View$1.onClick(View.java:2144)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View.performClick(View.java:2485)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View$PerformClick.run(View.java:9080)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.os.Handler.handleCallback(Handler.java:587)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.os.Handler.dispatchMessage(Handler.java:92)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.os.Looper.loop(Looper.java:123)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:25:12.590: E/AndroidRuntime(477): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 18:25:12.590: E/AndroidRuntime(477): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 18:25:12.590: E/AndroidRuntime(477): at dalvik.system.NativeStart.main(Native Method)
06-24 18:25:12.590: E/AndroidRuntime(477): Caused by: java.lang.reflect.InvocationTargetException
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 18:25:12.590: E/AndroidRuntime(477): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.view.View$1.onClick(View.java:2139)
06-24 18:25:12.590: E/AndroidRuntime(477): ... 11 more
06-24 18:25:12.590: E/AndroidRuntime(477): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1405)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Activity.startActivityForResult(Activity.java:2827)
06-24 18:25:12.590: E/AndroidRuntime(477): at android.app.Activity.startActivity(Activity.java:2933)
06-24 18:25:12.590: E/AndroidRuntime(477): at com.myfirstapp.MyFirstActivity.sendMessage(MyFirstActivity.java:26)
06-24 18:25:12.590: E/AndroidRuntime(477): ... 14 more
<code>
not sure as how to debug this app.
Please advice
Thanks
SSAMEERR
Unable to find explicit activity class
{com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity};
have you declared this activity in your AndroidManifest.xml?
put the entry of the DisplayMessageActivity in manifest.......
it DisplayMessageActivity is first Activity use intent-filter other remove that.
<activity android:name=".DisplayMessageActivity" android:label="Demo App">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Add it to the DisplayMessageActivity manifest as
<application ... >
<activity android:name=".DisplayMessageActivity" />
...
</application>
The answer is in the logcat:
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myfirstapp/DisplayMessageActivity.java.DisplayMessageActivity}; have you declared this activity in your AndroidManifest.xml?
Declare the activity in your manifest like so (i.e. insert it somewhere between the <application> and </application> tags):
<activity android:name=".DisplayMessageActivity" />
This is a common beginners mistake... expect this error at least a couple more times before you get used to it. :)
Make sure your other activities in the project are added to the AndroidManifest.xml
You have to include your activity in Manifest like:
<activity android:name=".MyFirstActivity"
android:theme="#android:style/Theme.NoTitleBar">
</activity>

OPEN FEINT error in Android App

15 reports
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.oas.fruitkungfufree/com.openfeint.internal.ui.IntroFlow}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.openfeint.internal.Util.setOrientation(Util.java:36)
at com.openfeint.internal.ui.NestedWindow.onCreate(NestedWindow.java:32)
at com.openfeint.internal.ui.WebNav.onCreate(WebNav.java:93)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
Does any one have a solution for this??
This is a problem with your code, you can't use an object that is null. This is a hint.

Categories

Resources