Hi I have developed a Worklight application for android which uses Bluemix IBM Push, when I receive the notification, if the app is closed, it works fine and opens the app, but when the app is open the app crashes with the following error.
10-09 18:13:00.676: E/AndroidRuntime(4665): FATAL EXCEPTION: main
10-09 18:13:00.676: E/AndroidRuntime(4665): java.lang.ClassCastException: com.ibm.mobile.services.push.internal.InternalPushMessage cannot be cast to com.worklight.androidgap.push.GCMIntentService$Message
10-09 18:13:00.676: E/AndroidRuntime(4665): at com.worklight.androidgap.plugin.Push.onNewIntent(Push.java:193)
10-09 18:13:00.676: E/AndroidRuntime(4665): at org.apache.cordova.PluginManager.onNewIntent(PluginManager.java:371)
10-09 18:13:00.676: E/AndroidRuntime(4665): at org.apache.cordova.CordovaWebView.onNewIntent(CordovaWebView.java:874)
10-09 18:13:00.676: E/AndroidRuntime(4665): at org.apache.cordova.CordovaActivity.onNewIntent(CordovaActivity.java:702)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1225)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2472)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.ActivityThread.performNewIntents(ActivityThread.java:2485)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2494)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.ActivityThread.access$1400(ActivityThread.java:165)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1444)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.os.Handler.dispatchMessage(Handler.java:107)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.os.Looper.loop(Looper.java:194)
10-09 18:13:00.676: E/AndroidRuntime(4665): at android.app.ActivityThread.main(ActivityThread.java:5391)
10-09 18:13:00.676: E/AndroidRuntime(4665): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 18:13:00.676: E/AndroidRuntime(4665): at java.lang.reflect.Method.invoke(Method.java:525)
10-09 18:13:00.676: E/AndroidRuntime(4665): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
10-09 18:13:00.676: E/AndroidRuntime(4665): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
10-09 18:13:00.676: E/AndroidRuntime(4665): at dalvik.system.NativeStart.main(Native Method)
10-09 18:13:00.677: D/WLClient(4665): WLClient$ActivityListener.onActivityPaused in WLClient.java:1155 :: on activity paused com.Techathon.Techathon . activity count = 0
10-09 18:13:00.683: D/NONE(4665): Flush called
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): Logger$UncaughtExceptionHandler.uncaughtException in Logger.java:402 :: Uncaught Exception
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): java.lang.ClassCastException: com.ibm.mobile.services.push.internal.InternalPushMessage cannot be cast to com.worklight.androidgap.push.GCMIntentService$Message
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at com.worklight.androidgap.plugin.Push.onNewIntent(Push.java:193)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at org.apache.cordova.PluginManager.onNewIntent(PluginManager.java:371)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at org.apache.cordova.CordovaWebView.onNewIntent(CordovaWebView.java:874)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at org.apache.cordova.CordovaActivity.onNewIntent(CordovaActivity.java:702)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.Instrumentation.callActivityOnNewIntent(Instrumentation.java:1225)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.ActivityThread.deliverNewIntents(ActivityThread.java:2472)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.ActivityThread.performNewIntents(ActivityThread.java:2485)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.ActivityThread.handleNewIntent(ActivityThread.java:2494)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.ActivityThread.access$1400(ActivityThread.java:165)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1444)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.os.Handler.dispatchMessage(Handler.java:107)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.os.Looper.loop(Looper.java:194)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at android.app.ActivityThread.main(ActivityThread.java:5391)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at java.lang.reflect.Method.invoke(Method.java:525)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
10-09 18:13:00.718: E/com.worklight.common.Logger$UncaughtExceptionHandler(4665): at dalvik.system.NativeStart.main(Native Method)
10-09 18:13:02.586: I/Process(4665): Sending signal. PID: 4665 SIG: 9
I have setup my enviroment according the link provided here http://mbaas-gettingstarted.ng.bluemix.net/hybrid
Have you tried editing your AndroidManifest.xml to remove the references to GCMIntentService?
You might be able to comment out the sections as explained here:
https://developer.ibm.com/answers/questions/19343/double-push-notifications/?smartspace=bluemix
That way you will be only using the Bluemix Push SDK to respond to push notifications. Hopefully avoiding that error entirely.
EDIT: After some playing around I figured out that the Push plugin was to blame for the conflicting SDKs. After I commented out the Worklight Push plugin in the config.xml the error disappeared.
Comment these lines and try again:
<feature name="Push">
<param name="android-package" value="com.worklight.androidgap.plugin.Push" />
</feature>
Related
I am having problems locating the nullpointerexeption that keeps coming up. The log cat does not show a "caused by" tag and that is what is making it difficult to find out what the actual problem is. If anyone could just guide me to finding out what the problem is then that would be great. I have also tried running the debugger and I get the provided error, but I have no clue what to do about it. Below is the error messages that I keep getting, and if need be I will post the code.
Debugger:
Thread [<1> main] (Suspended (exception NullPointerException))
<VM does not provide monitor information>
Choreographer.doCallbacks(int, long) line: 565
Choreographer.doFrame(long, int) line: 532
Choreographer$FrameDisplayEventReceiver.run() line: 735
Handler.handleCallback(Message) line: 725
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 92
Looper.loop() line: 137
ActivityThread.main(String[]) line: 5329
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 511
ZygoteInit$MethodAndArgsCaller.run() line: 1102
ZygoteInit.main(String[]) line: 869
NativeStart.main(String[]) line: not available [native method]
Log Cat Error:
10-09 13:14:35.675: D/dalvikvm(12528): GC_CONCURRENT freed 825K, 9% free 35986K/39424K, paused 3ms+6ms, total 26ms
10-09 13:14:35.675: D/dalvikvm(12528): WAIT_FOR_CONCURRENT_GC blocked 2ms
10-09 13:14:35.705: I/endeffect(12528): AbsListView.onMeasure(), getWidth()=1080, getHeight()=1806, this=android.widget.ExpandableListView{43a168c0 VFED.VC. .F....ID 0,0-1080,1806 #7f060023 app:id/exp_list_view_deals_events}
10-09 13:14:35.705: D/AndroidRuntime(12528): Shutting down VM
10-09 13:14:35.705: W/dalvikvm(12528): threadid=1: thread exiting with uncaught exception (group=0x41467ac8)
10-09 13:14:35.716: E/AndroidRuntime(12528): FATAL EXCEPTION: main
10-09 13:14:35.716: E/AndroidRuntime(12528): java.lang.NullPointerException
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.AbsListView.obtainView(AbsListView.java:2615)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.ListView.measureHeightOfChildren(ListView.java:1253)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.ListView.onMeasure(ListView.java:1165)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:681)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1410)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4923)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
10-09 13:14:35.716: E/AndroidRuntime(12528): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2414)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.View.measure(View.java:16059)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2133)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1286)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1497)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1183)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4863)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.Choreographer.doCallbacks(Choreographer.java:562)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.Choreographer.doFrame(Choreographer.java:532)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.os.Handler.handleCallback(Handler.java:725)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.os.Handler.dispatchMessage(Handler.java:92)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.os.Looper.loop(Looper.java:137)
10-09 13:14:35.716: E/AndroidRuntime(12528): at android.app.ActivityThread.main(ActivityThread.java:5329)
10-09 13:14:35.716: E/AndroidRuntime(12528): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 13:14:35.716: E/AndroidRuntime(12528): at java.lang.reflect.Method.invoke(Method.java:511)
10-09 13:14:35.716: E/AndroidRuntime(12528): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
10-09 13:14:35.716: E/AndroidRuntime(12528): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
10-09 13:14:35.716: E/AndroidRuntime(12528): at dalvik.system.NativeStart.main(Native Method)
You are return null in your getView() function.
See here:
Crash in ListView at AbsListView.obtainView for ListActivity
Here's the output I'm taking about:
10-09 21:57:56.344: W/dalvikvm(3141): threadid=1: thread exiting with uncaught exception (group=0x40cb8378)
10-09 21:57:56.364: E/AndroidRuntime(3141): FATAL EXCEPTION: main
10-09 21:57:56.364: E/AndroidRuntime(3141): java.lang.IllegalStateException: Activity has been destroyed
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1329)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:548)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:532)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.trade.MainActivity.showFragment(MainActivity.java:85)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.trade.MainActivity.showSettingsFragment(MainActivity.java:179)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.trade.Home.setting(Home.java:40)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.trade.Home.onOptionsItemSelected(Home.java:31)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.app.Activity.onMenuItemSelected(Activity.java:2534)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:353)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:964)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.view.menu.ListMenuPresenter.onItemClick(ListMenuPresenter.java:166)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.widget.AdapterView.performItemClick(AdapterView.java:298)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.widget.AbsListView.performItemClick(AbsListView.java:1086)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2859)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.widget.AbsListView$1.run(AbsListView.java:3533)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.os.Handler.handleCallback(Handler.java:615)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.os.Handler.dispatchMessage(Handler.java:92)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.os.Looper.loop(Looper.java:213)
10-09 21:57:56.364: E/AndroidRuntime(3141): at android.app.ActivityThread.main(ActivityThread.java:4787)
10-09 21:57:56.364: E/AndroidRuntime(3141): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 21:57:56.364: E/AndroidRuntime(3141): at java.lang.reflect.Method.invoke(Method.java:511)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
10-09 21:57:56.364: E/AndroidRuntime(3141): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
10-09 21:57:56.364: E/AndroidRuntime(3141): at dalvik.system.NativeStart.main(Native Method)
10-09 21:57:58.847: I/Process(3141): Sending signal. PID: 3141 SIG: 9
The exception is unknown to me. Please help me understand it.
Thanks
I will try my best to answer your general question in a general regard to the excpetion, since that is what you asked. If you want specific help for a specific bug in your application you will need to post your MainActivity here (especially the parts around line 85).
The excpetion you are getting is an android system exception that is there to tell you that you are operating on an Activity that is not "alive" anymore. This is surprisingly easy to achieve and has most likely to do with improper variable householding (or improper instance householding as was mentioned in the comments below your question. Do not build Activity instances yourself via the new operator). An example might be as follows
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class MyActivity extends Activity {
public static Activity instance;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (instance != null) {
instance.setContentView(R.layout.myLayout);
}
instance = this;
finish();
startActivity(new Intent(this, MyActivity.class));
}
}
As you might recognize in this simple example, the variable instance is only read upon the first re-entrance into the activity! But there is still a reference to the old (now "dead") activity in there. So what should the system do? Perform an action on this "dead" activity? No, it will give you the above seen exception
So in short: it is very likely that you either have a Fragment, a Dialog or another integral part of the UI "operating on" a "dead" activity (operating on = using a reference to it or some resources (FragmentManager...) from it)
As I said your error is probably very easy to fix, give us your code and we'll be able to help. But maybe you are even able to fix it yourself using the above information - which would surely be more satisfactory to yourself I guess :)
I'm a newbie in Android and working on my first app.
I have the main activity with no ActionBar in it. And I don't want to display any menu in that Activity. Everything is working just fine But when I press the menu button present in the device itself, it causes my app to force close instead of just ignoring it.
I'm developing for sdk >=8 so I'm using the support library. I have tried adding OnCreateOptionMenu() in the code with nothing in it but ended up with same results.
The name of my app is GUI and the package is gui. Here is the Logcat:
10-09 19:52:32.920: E/AndroidRuntime(7440): FATAL EXCEPTION: main
10-09 19:52:32.920: E/AndroidRuntime(7440): java.lang.NullPointerException
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarImplICS.getThemedContext(ActionBarImplICS.java:274)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarActivityDelegate.getMenuInflater(ActionBarActivityDelegate.java:89)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarActivity.getMenuInflater(ActionBarActivity.java:71)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.app.Activity.onCreatePanelMenu(Activity.java:2554)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:224)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarActivity.superOnCreatePanelMenu(ActionBarActivity.java:224)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarActivityDelegateICS.onCreatePanelMenu(ActionBarActivityDelegateICS.java:141)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarActivity.onCreatePanelMenu(ActionBarActivity.java:199)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.onCreatePanelMenu(ActionBarActivityDelegateICS.java:280)
10-09 19:52:32.920: E/AndroidRuntime(7440): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:453)
10-09 19:52:32.920: E/AndroidRuntime(7440): at com.android.internal.policy.impl.PhoneWindow.onKeyDownPanel(PhoneWindow.java:853)
10-09 19:52:32.920: E/AndroidRuntime(7440): at com.android.internal.policy.impl.PhoneWindow.onKeyDown(PhoneWindow.java:1535)
10-09 19:52:32.920: E/AndroidRuntime(7440): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2052)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.view.ViewRootImpl.deliverKeyEventPostIme(ViewRootImpl.java:3924)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.view.ViewRootImpl.handleImeFinishedEvent(ViewRootImpl.java:3872)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3007)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.os.Looper.loop(Looper.java:137)
10-09 19:52:32.920: E/AndroidRuntime(7440): at android.app.ActivityThread.main(ActivityThread.java:4921)
10-09 19:52:32.920: E/AndroidRuntime(7440): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 19:52:32.920: E/AndroidRuntime(7440): at java.lang.reflect.Method.invoke(Method.java:511)
10-09 19:52:32.920: E/AndroidRuntime(7440): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
10-09 19:52:32.920: E/AndroidRuntime(7440): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
10-09 19:52:32.920: E/AndroidRuntime(7440): at dalvik.system.NativeStart.main(Native Method)
I can't figure out what's the cause of this error. Please help me to locate it. If any other info is needed then plz let me know.
My guess is that this is a bug in the AppCompat library. If you take a look at the code for ActionBarImplICS.getThemedContext() you see that it's the mActionBar that is null:
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.3_r1/android/support/v7/app/ActionBarImplICS.java#ActionBarImplICS.getThemedContext%28%29
My guess is that you're using an activity without a title (and thus also without an actionbar):
requestWindowFeature(Window.FEATURE_NO_TITLE);
If I remove this and launch the activity with a title/actionbar I haven't been able to reproduce the crash. Now, running the app with a titlebar when you don't want or need one isn't a very good option. My suggestion is that you override the Menu key press. The app stopped crashing for me when I did this:
#Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ( keyCode == KeyEvent.KEYCODE_MENU ) {
// do nothing
return true;
}
return super.onKeyDown(keyCode, event);
}
Looks like this will be fixed in the next support library release http://code.google.com/p/android/issues/detail?id=61394
I have a phone Galaxy S (GT-I9003) that is unable to play a video with resolution (320x480) while all the other models of Galaxy S are able to display that video.
Here are the logs
10-09 06:44:54.232: W/MediaPlayer(1907): info/warning (1, 26)
10-09 06:44:54.232: E/PlayerDriver(1278): Command PLAYER_INIT completed with an error or info PVMFFailure
10-09 06:44:54.232: E/MediaPlayer(1907): error (1, -1)
10-09 06:44:54.232: W/System.err(1907): java.io.IOException: Prepare failed.: status=0x1
10-09 06:44:54.240: W/System.err(1907): at android.media.MediaPlayer.prepare(Native Method)
10-09 06:44:54.240: W/System.err(1907): at com.MovieController.startMovie(MovieController.java:180)
10-09 06:44:54.240: W/System.err(1907): at com.MovieController.show(MovieController.java:88)
10-09 06:44:54.240: W/System.err(1907): at com.MovieController.play(MovieController.java:120)
10-09 06:44:54.240: W/System.err(1907): at com.android.sphybrid.D2CommandController.execute(D2CommandController.java:73)
10-09 06:44:54.240: W/System.err(1907): at com.android.sphybrid.WGFWebViewClient.doWithTitle(WGFWebViewClient.java:114)
10-09 06:44:54.240: W/System.err(1907): at com.android.sphybrid.WGFWebViewClient.onPageFinished(WGFWebViewClient.java:93)
10-09 06:44:54.240: W/System.err(1907): at jp.android.survivors.WebViewClient.onPageFinished(WebViewClient.java:96)
10-09 06:44:54.240: W/System.err(1907): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:281)
10-09 06:44:54.240: W/System.err(1907): at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 06:44:54.240: W/System.err(1907): at android.os.Looper.loop(Looper.java:123)
10-09 06:44:54.240: W/System.err(1907): at android.app.ActivityThread.main(ActivityThread.java:4632)
10-09 06:44:54.240: W/System.err(1907): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 06:44:54.240: W/System.err(1907): at java.lang.reflect.Method.invoke(Method.java:521)
10-09 06:44:54.240: W/System.err(1907): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-09 06:44:54.240: W/System.err(1907): at dalvik.system.NativeStart.main(Native Method)
10-09 06:44:54.240: I/MovieFile(1907): Movie File: <null>
10-09 06:44:54.248: W/PlayerDriver(1278): PVMFInfoErrorHandlingComplete
10-09 06:44:54.279: I/AudioFlinger(1278): getNextBuffer() no more data for track 4096 on thread 0x34cc8
10-09 06:44:55.709: D/wpa_supplicant(1474): wpa_driver_tista_driver_cmd LINKSPEED
10-09 06:44:55.709: D/wpa_supplicant(1474): Link Speed command
10-09 06:44:55.709: D/wpa_supplicant(1474): buf LinkSpeed 54
10-09 06:44:56.287: I/AudioStreamOutALSA(1278): (virtual android::status_t android::AudioStreamOutALSA::standby()) enter
10-09 06:44:56.373: D/AudioStreamOutALSA(1278): Output standby called!!. Turn off PCM device.
10-09 06:44:56.373: I/ALSAStreamOps(1278): [ALSAStreamOps]codecOff mode = 0
10-09 06:44:56.373: D/ALSAControl(1278): ALSAControl::set index = 0
10-09 06:44:56.373: I/ALSAControl(1278): <set>id = 1079651552, info = 1079651272, name = Amp Enable
10-09 06:44:56.373: I/ALSAControl(1278): <set>mHandle Success 215600
10-09 06:44:56.420: D/BT HS/HF(1489): gsmAsuToSignal=27
10-09 06:44:56.420: D/ALSAControl(1278): ALSAControl::set index = 0
10-09 06:44:56.420: I/ALSAControl(1278): <set>id = 1079651552, info = 1079651272, name = Idle Mode
10-09 06:44:56.420: I/ALSAControl(1278): <set>mHandle Success 215600
10-09 06:44:56.490: I/AudioStreamOutALSA(1278): [AudioOutLock]Relase_wake_Lock
I just found out that the movie i was trying to play in Android 2.2.1 was in some other codec (JVT/AC) and resolution was (320 x 480). I changed the codec to MPEG-4 without changing the resolution, it started working. I suppose it is an unsupported format.
How to connect the application from the monkey talk ide? I am trying to run the android application on monkey talk. I installed android sdk, monkey talk, eclipse, and trying to run the application as per the documentation. but I am failed to run the app, force close occurred every time in emulator . its showing some FATAL exception. please help to get rid of this ...
10-09 11:05:16.648: ERROR/AndroidRuntime(277): FATAL EXCEPTION: main
10-09 11:05:16.648: ERROR/AndroidRuntime(277): java.lang.ExceptionInInitializerError
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at java.lang.Class.newInstanceImpl(Native Method)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at java.lang.Class.newInstance(Class.java:1429)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.os.Looper.loop(Looper.java:123)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at java.lang.reflect.Method.invokeNative(Native Method)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at java.lang.reflect.Method.invoke(Method.java:521)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at dalvik.system.NativeStart.main(Native Method)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): Caused by: java.lang.NoClassDefFoundError: org.aspectj.runtime.reflect.Factory
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at com.mytest.Mymonkeytest1Activity.ajc$preClinit(Mymonkeytest1Activity.java:1)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): at com.mytest.Mymonkeytest1Activity.(Mymonkeytest1Activity.java:1)
10-09 11:05:16.648: ERROR/AndroidRuntime(277): ... 15 more
10-09 11:05:16.708: WARN/ActivityManager(59): Force finishing activity com.mytest/.Mymonkeytest1Activity
10-09 11:05:17.288: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{44efd5f0 com.mytest/.Mymonkeytest1Activity}
Thanks in advance ....