As mentioned in the title, when compiling, the Console says: Failed to install ap.apk
But the logcat shows this:
02-21 00:45:25.052: W/dalvikvm(921): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
02-21 00:45:25.272: E/AndroidRuntime(921): FATAL EXCEPTION: main
02-21 00:45:25.272: E/AndroidRuntime(921): java.lang.IllegalStateException: Could not find a method retour(View) in the activity class hd.android.contact.ContactActionActivity for onClick handler on view class android.widget.Button with id 'button5'
02-21 00:45:25.272: E/AndroidRuntime(921): at android.view.View$1.onClick(View.java:3031)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.view.View.performClick(View.java:3511)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.view.View$PerformClick.run(View.java:14105)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.os.Handler.handleCallback(Handler.java:605)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.os.Handler.dispatchMessage(Handler.java:92)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.os.Looper.loop(Looper.java:137)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.app.ActivityThread.main(ActivityThread.java:4424)
02-21 00:45:25.272: E/AndroidRuntime(921): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 00:45:25.272: E/AndroidRuntime(921): at java.lang.reflect.Method.invoke(Method.java:511)
02-21 00:45:25.272: E/AndroidRuntime(921): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-21 00:45:25.272: E/AndroidRuntime(921): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
02-21 00:45:25.272: E/AndroidRuntime(921): at dalvik.system.NativeStart.main(Native Method)
**02-21 00:45:25.272: E/AndroidRuntime(921): Caused by: java.lang.NoSuchMethodException: retour [class android.view.View]**
02-21 00:45:25.272: E/AndroidRuntime(921): at java.lang.Class.getConstructorOrMethod(Class.java:460)
02-21 00:45:25.272: E/AndroidRuntime(921): at java.lang.Class.getMethod(Class.java:915)
02-21 00:45:25.272: E/AndroidRuntime(921): at android.view.View$1.onClick(View.java:3024)
I commented all my "retour" methods and deleted all android:onClick related to this method, and it did not help...Everything was working fine before...
Can anybody help please?
Thank you in advance
IllegalStateException: Could not find a method retour(View)
I think the problem is that you (definitely) have specified onClick on a method retour in the XML but the method
is not present in the Java code.
If the problem continues, try cleaning the project and shutting down your softphone.
Related
We tried integrating HelpStack by following steps given on GitHub, but we kept getting the following errors:
04-03 13:54:22.054 4638-4638/com.playerline.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.playerline.android/com.tenmiles.helpstack.activities.HomeActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.tenmiles.helpstack.activities.HSActivityParent.onCreate(HSActivityParent.java:48)
at com.tenmiles.helpstack.activities.HomeActivity.onCreate(HomeActivity.java:46)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
I'm guessing it has something to do with the App Theme, which in our case is is Theme.AppCompat.NoActionBar.
I made some changes to my app and now I'm getting this error that seems to be related to a class (ViewUser) that i do not changed.
I tried to undo some changes that i made in other classes but i cannot figure out what could cause this error.
I double checked somethings according to this answer but i do not solved.
Here is the LogCat:
02-21 11:46:43.133: E/AndroidRuntime(22002): FATAL EXCEPTION: main
02-21 11:46:43.133: E/AndroidRuntime(22002): Process: com.myapp, PID: 22002
02-21 11:46:43.133: E/AndroidRuntime(22002): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.ViewUser}: java.lang.NullPointerException
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2212)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2271)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.ActivityThread.access$800(ActivityThread.java:144)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.os.Handler.dispatchMessage(Handler.java:102)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.os.Looper.loop(Looper.java:136)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.ActivityThread.main(ActivityThread.java:5146)
02-21 11:46:43.133: E/AndroidRuntime(22002): at java.lang.reflect.Method.invokeNative(Native Method)
02-21 11:46:43.133: E/AndroidRuntime(22002): at java.lang.reflect.Method.invoke(Method.java:515)
02-21 11:46:43.133: E/AndroidRuntime(22002): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
02-21 11:46:43.133: E/AndroidRuntime(22002): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
02-21 11:46:43.133: E/AndroidRuntime(22002): at dalvik.system.NativeStart.main(Native Method)
02-21 11:46:43.133: E/AndroidRuntime(22002): Caused by: java.lang.NullPointerException
02-21 11:46:43.133: E/AndroidRuntime(22002): at com.myapp.ViewUser.onCreate(ViewUser.java:33)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.Activity.performCreate(Activity.java:5231)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
02-21 11:46:43.133: E/AndroidRuntime(22002): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2169)
02-21 11:46:43.133: E/AndroidRuntime(22002): ... 11 more
Please tell me if i have to show you some files, thank you in advance!
I restarted Eclipse and now it works! O_o
My App crash rarely
i want to get off this bug for ever.
this is the log that users Report
i tried so long on this but nothing helps
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.xxx/com.xxx.xxx.Master_}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2072)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2097)
at android.app.ActivityThread.access$600(ActivityThread.java:136)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4787)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.xxx.xxx.HomeFragment.onActivityCreated(HomeFragment.java:140)
at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:1508)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:958)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1115)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1097)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1895)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:566)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
at android.app.Activity.performStart(Activity.java:5018)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2045)
... 11 more
I've made my Android app tablet optimized and I followed the tutorial here:
Everything is great, but I am trying to select an item (say, the 1st item) with a button in the ActionBar.
I tried this answer to use performItemClick but on I've got error reports of java.lang.IllegalStateException
in android.support.v4.app.ListFragment.ensureList, java.lang.IllegalStateException: Content view not yet created, and java.lang.NullPointerException
in android.content.ComponentName.<init>
I've tried checking if the ListView is null and still get the error reports on the Play Store. How do I properly select an item in my list programmatically?
Update to add logcat and the code is virtually identical to the tutorials in the links:
Logcat A:
java.lang.IllegalStateException: Content view not yet created
at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:69)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1280)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2606)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1045)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:592)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:149)
at android.view.View.performClick(View.java:4222)
at android.view.View$PerformClick.run(View.java:17273)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Logcat B:
java.lang.NullPointerException
at android.content.ComponentName.<init>(ComponentName.java:75)
at android.content.Intent.<init>(Intent.java:2874)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:86)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3701)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2205)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:779)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:861)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Update 2
And here is the code that is causing the problem:
if (mListFragment.listView != null) {
mListFragment.listView.performItemClick(mListFragment.listView.getAdapter().getView(position, null, null), position, mListFragment.listView.getAdapter().getItemId(position));
}
I can't find following error in my code. It looks like the problem is in the asynctask onpostexecute.
java.lang.IllegalArgumentException: View not attached to window manager
at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:672)
at android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:368)
at android.view.WindowManagerImpl$CompatModeWrapper.removeView(WindowManagerImpl.java:160)
at android.app.Dialog.dismissDialog(Dialog.java:319)
at android.app.Dialog.dismiss(Dialog.java:302)
at www.mobilezar.mn.Advertisements$InitialLoading.onPostExecute(Advertisements.java:216)
at www.mobilezar.mn.Advertisements$InitialLoading.onPostExecute(Advertisements.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:631)
at android.os.AsyncTask.access$600(AsyncTask.java:177)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(Native Method)