I keep getting an exception when I want to display an alertdialog at the beginning of an activity.
I can't figure out why? I really would appreciate an explanation.
The code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
if (!isInternetConnectionAvailable()) {
AlertDialog alert = new AlertDialog.Builder(getApplicationContext()).create();
alert.setMessage("TEST DIALOG!!!");
alert.show();
}
...
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): FATAL EXCEPTION: main
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): java.lang.RuntimeException: Unable to start activity ComponentInfo{de.droidgroup.THMInfo/de.droidgroup.THMInfo.Activities.StartActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.os.Handler.dispatchMessage(Handler.java:99)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.os.Looper.loop(Looper.java:123)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at java.lang.reflect.Method.invoke(Method.java:521)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at dalvik.system.NativeStart.main(Native Method)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.view.ViewRoot.setView(ViewRoot.java:509)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.Dialog.show(Dialog.java:241)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at de.droidgroup.THMInfo.Activities.StartActivity.onCreate(StartActivity.java:82)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-19 16:04:33.933: ERROR/AndroidRuntime(15145): ... 11 more
Use this instead of getApplicationContext(). More info here.
Related
i have this problem:
when i try start my emulator in eclipse i wait 15 minutes and it is not started.
I try reinstall eclipse but emulator still dont working.
03-19 15:26:38.960: E/Installer(438): connection failed
03-19 15:26:39.530: E/System(438): ******************************************
03-19 15:26:39.530: E/System(438): ************ Failure starting bootstrap service
03-19 15:26:39.530: E/System(438): java.lang.NullPointerException
03-19 15:26:39.530: E/System(438): at com.android.server.firewall.IntentFirewall.readRulesDir(IntentFirewall.java:271)
03-19 15:26:39.530: E/System(438): at com.android.server.firewall.IntentFirewall.<init>(IntentFirewall.java:114)
03-19 15:26:39.530: E/System(438): at com.android.server.am.ActivityManagerService.main(ActivityManagerService.java:1804)
03-19 15:26:39.530: E/System(438): at com.android.server.ServerThread.initAndLoop(SystemServer.java:196)
03-19 15:26:39.530: E/System(438): at com.android.server.SystemServer.main(SystemServer.java:1179)
03-19 15:26:39.530: E/System(438): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 15:26:39.530: E/System(438): at java.lang.reflect.Method.invoke(Method.java:515)
03-19 15:26:39.530: E/System(438): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-19 15:26:39.530: E/System(438): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-19 15:26:39.530: E/System(438): at dalvik.system.NativeStart.main(Native Method)
03-19 15:26:39.630: E/AndroidRuntime(438): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManager
03-19 15:26:39.630: E/AndroidRuntime(438): java.lang.NullPointerException
03-19 15:26:39.630: E/AndroidRuntime(438): at com.android.server.display.LocalDisplayAdapter$LocalDisplayDevice.getDisplayDeviceInfoLocked(LocalDisplayAdapter.java:147)
03-19 15:26:39.630: E/AndroidRuntime(438): at com.android.server.display.DisplayManagerService.handleDisplayDeviceAddedLocked(DisplayManagerService.java:852)
03-19 15:26:39.630: E/AndroidRuntime(438): at com.android.server.display.DisplayManagerService.handleDisplayDeviceAdded(DisplayManagerService.java:841)
03-19 15:26:39.630: E/AndroidRuntime(438): at com.android.server.display.DisplayManagerService.access$1100(DisplayManagerService.java:96)
03-19 15:26:39.630: E/AndroidRuntime(438): at com.android.server.display.DisplayManagerService$DisplayAdapterListener.onDisplayDeviceEvent(DisplayManagerService.java:1281)
03-19 15:26:39.630: E/AndroidRuntime(438): at com.android.server.display.DisplayAdapter$1.run(DisplayAdapter.java:108)
03-19 15:26:39.630: E/AndroidRuntime(438): at android.os.Handler.handleCallback(Handler.java:733)
03-19 15:26:39.630: E/AndroidRuntime(438): at android.os.Handler.dispatchMessage(Handler.java:95)
03-19 15:26:39.630: E/AndroidRuntime(438): at android.os.Looper.loop(Looper.java:136)
03-19 15:26:39.630: E/AndroidRuntime(438): at android.os.HandlerThread.run(HandlerThread.java:61)
03-19 15:26:39.640: E/AndroidRuntime(438): Error reporting crash
03-19 15:26:39.640: E/AndroidRuntime(438): java.lang.NullPointerException
03-19 15:26:39.640: E/AndroidRuntime(438): at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:84)
03-19 15:26:39.640: E/AndroidRuntime(438): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
03-19 15:26:39.640: E/AndroidRuntime(438): at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
03-19 15:27:46.600: E/Installer(796): connection failed
03-19 15:27:47.120: E/System(796): ******************************************
03-19 15:27:47.120: E/System(796): ************ Failure starting bootstrap service
03-19 15:27:47.120: E/System(796): java.lang.NullPointerException
03-19 15:27:47.120: E/System(796): at com.android.server.firewall.IntentFirewall.readRulesDir(IntentFirewall.java:271)
03-19 15:27:47.120: E/System(796): at com.android.server.firewall.IntentFirewall.<init>(IntentFirewall.java:114)
03-19 15:27:47.120: E/System(796): at com.android.server.am.ActivityManagerService.main(ActivityManagerService.java:1804)
03-19 15:27:47.120: E/System(796): at com.android.server.ServerThread.initAndLoop(SystemServer.java:196)
03-19 15:27:47.120: E/System(796): at com.android.server.SystemServer.main(SystemServer.java:1179)
03-19 15:27:47.120: E/System(796): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 15:27:47.120: E/System(796): at java.lang.reflect.Method.invoke(Method.java:515)
03-19 15:27:47.120: E/System(796): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-19 15:27:47.120: E/System(796): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-19 15:27:47.120: E/System(796): at dalvik.system.NativeStart.main(Native Method)
I install eclipse with adt with sdk for android and i can not start emulator.
Thank you for help.
Try opening emulator with less device screen size like 3.2'and wait for emulator to launch,on first occasion it might take some time.
Emulator with high config and screen size takes ages to open and sometimes does not even launch no matter what.
I had the same problem and i opened emulator using small screen resolution and boom it worked. :) Try it.
I tried to build the Cocos2D-x testCpp sample project (Cocos2D-x 2.2.2) on my Android device using the command line interface as described in the Readme.md file:
$ cd cocos2d-x/samples/Cpp/TestCpp/proj.android/
$ export NDK_ROOT=/path/to/ndk
$ ./build_native.sh
$ ant debug install
If the last command results in sdk.dir missing error then do:
$ android list target
$ android update project -p . -t (id from step 6)
$ android update project -p cocos2d-x/cocos2dx/platform/android/java/ -t (id from step 6)
I can install the app on my device (Galaxy S4) but the application crashes immediately after the launch telling me the application was stopped.
Any idea what I can do to fix that problem?
I am not sure how to use logcat within the CLI, so I startet the sample application using eclipse (the error here is the same: application crashes after launch) and post the logcat info shown by eclipse:
03-19 10:49:22.785: W/dalvikvm(6591): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/cocos2dx/hellocpp/HelloCpp;
03-19 10:49:22.785: W/dalvikvm(6591): Class init failed in newInstance call (Lorg/cocos2dx/hellocpp/HelloCpp;)
03-19 10:49:22.785: D/AndroidRuntime(6591): Shutting down VM
03-19 10:49:22.785: W/dalvikvm(6591): threadid=1: thread exiting with uncaught exception (group=0x4195f898)
03-19 10:49:22.785: E/AndroidRuntime(6591): FATAL EXCEPTION: main
03-19 10:49:22.785: E/AndroidRuntime(6591): java.lang.UnsatisfiedLinkError: Couldn't load hellocpp from loader dalvik.system.PathClassLoader[dexPath=/data/app/org.cocos2dx.hellocpp-1.apk,libraryPath=/data/app-lib/org.cocos2dx.hellocpp-1]: findLibrary returned null
03-19 10:49:22.785: E/AndroidRuntime(6591): at java.lang.Runtime.loadLibrary(Runtime.java:355)
03-19 10:49:22.785: E/AndroidRuntime(6591): at java.lang.System.loadLibrary(System.java:525)
03-19 10:49:22.785: E/AndroidRuntime(6591): at org.cocos2dx.hellocpp.HelloCpp.(HelloCpp.java:37)
03-19 10:49:22.785: E/AndroidRuntime(6591): at java.lang.Class.newInstanceImpl(Native Method)
03-19 10:49:22.785: E/AndroidRuntime(6591): at java.lang.Class.newInstance(Class.java:1130)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2210)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.app.ActivityThread.access$700(ActivityThread.java:159)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.os.Handler.dispatchMessage(Handler.java:99)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.os.Looper.loop(Looper.java:137)
03-19 10:49:22.785: E/AndroidRuntime(6591): at android.app.ActivityThread.main(ActivityThread.java:5419)
03-19 10:49:22.785: E/AndroidRuntime(6591): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 10:49:22.785: E/AndroidRuntime(6591): at java.lang.reflect.Method.invoke(Method.java:525)
03-19 10:49:22.785: E/AndroidRuntime(6591): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
03-19 10:49:22.785: E/AndroidRuntime(6591): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
03-19 10:49:22.785: E/AndroidRuntime(6591): at dalvik.system.NativeStart.main(Native Method)
seems that your building is not successful according to the log. no hellocpp.so is generated. so it crashes when you call the method
loadLibrary();
you can check this under youPath/proj.android/libs/armeabi , see if there's a libxxx.so file.
Every time this has happened to me it has always been because I forgot to run ./build_native.sh in the "proj.android" folder of the project in question. #Lorin actually noted the symptom that reminded me. A reason that a libxxx.so file would be missing is the ./build_native.sh script has yet to be run
When you run eclipse to build it is happening in the background. When you compile from command line you need to remember to to have run the script at least once (and every time (if) you ever make a change to the cocos2dx framework itself.) I frequently forget to do that for EVERY project thereafter.
I am new to Android technology, and I am creating a practice app. I have created a mail sending class that is used in two Activities. In one Activity it is working fine, but in the other it is not working -- there is an error in the logcat and I am unable to find what is causing it. Here is the error log:
03-19 12:11:23.773: E/WindowManager(891): Activity com.example.mytest.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{40d0de70 V.E..... R.....ID 0,0-97,92} that was originally added here
03-19 12:11:23.773: E/WindowManager(891): android.view.WindowLeaked: Activity com.example.mytest.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{40d0de70 V.E..... R.....ID 0,0-97,92} that was originally added here
03-19 12:11:23.773: E/WindowManager(891): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:354)
03-19 12:11:23.773: E/WindowManager(891): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:216)
03-19 12:11:23.773: E/WindowManager(891): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
03-19 12:11:23.773: E/WindowManager(891): at android.app.Dialog.show(Dialog.java:281)
03-19 12:11:23.773: E/WindowManager(891): at com.example.mytest.MainActivity$CountDownTask.onPreExecute(MainActivity.java:289)
03-19 12:11:23.773: E/WindowManager(891): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
03-19 12:11:23.773: E/WindowManager(891): at android.os.AsyncTask.execute(AsyncTask.java:534)
03-19 12:11:23.773: E/WindowManager(891): at com.example.mytest.MainActivity.CallLogsBackup(MainActivity.java:91)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invoke(Method.java:511)
03-19 12:11:23.773: E/WindowManager(891): at android.view.View$1.onClick(View.java:3592)
03-19 12:11:23.773: E/WindowManager(891): at android.view.View.performClick(View.java:4202)
03-19 12:11:23.773: E/WindowManager(891): at android.view.View$PerformClick.run(View.java:17340)
03-19 12:11:23.773: E/WindowManager(891): at android.os.Handler.handleCallback(Handler.java:725)
03-19 12:11:23.773: E/WindowManager(891): at android.os.Handler.dispatchMessage(Handler.java:92)
03-19 12:11:23.773: E/WindowManager(891): at android.os.Looper.loop(Looper.java:137)
03-19 12:11:23.773: E/WindowManager(891): at android.app.ActivityThread.main(ActivityThread.java:5039)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 12:11:23.773: E/WindowManager(891): at java.lang.reflect.Method.invoke(Method.java:511)
03-19 12:11:23.773: E/WindowManager(891): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-19 12:11:23.773: E/WindowManager(891): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
03-19 12:11:23.773: E/WindowManager(891): at dalvik.system.NativeStart.main(Native Method)
I am an Android developer and I am trying to send a Serializable object to another Activity using a Bundle. However, I get the following - Parcelable encountered ClassNotFoundException reading a Serializable object as an error.
What is the cause of this and how can I fix it?
Below is the code snippet:
Bundle previousData = new Bundle();
previousData.putSerializable("GetVehicleInfo_AllTrims", trimsObj);// trimObj is a serialized object
Intent detailsIntent = new Intent(androidScrolbleTabbar.TABBAR_PUSHVIEW);
detailsIntent.putExtras(previousData);
detailsIntent.putExtra("ActivityIdentifier", ManualScreenNav2.viewIdentifier);
detailsIntent.putExtra("className", ManualScreenNav2.class.getName());
sendBroadcast(detailsIntent);
Below is the full stack trace:
03-19 15:39:02.549: E/AndroidRuntime(27084): FATAL EXCEPTION: main
03-19 15:39:02.549: E/AndroidRuntime(27084): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.mobyfactory.pushview (has extras) } in com.adplotmanagement.androidScrolbleTabbar$PUSHViewBroadcastReceiver#461bc340
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:942)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Handler.handleCallback(Handler.java:587)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Handler.dispatchMessage(Handler.java:92)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Looper.loop(Looper.java:143)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.app.ActivityThread.main(ActivityThread.java:4701)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.lang.reflect.Method.invokeNative(Native Method)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.lang.reflect.Method.invoke(Method.java:521)
03-19 15:39:02.549: E/AndroidRuntime(27084): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-19 15:39:02.549: E/AndroidRuntime(27084): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-19 15:39:02.549: E/AndroidRuntime(27084): at dalvik.system.NativeStart.main(Native Method)
03-19 15:39:02.549: E/AndroidRuntime(27084): Caused by: java.lang.RuntimeException: Parcelable encounteredClassNotFoundException reading a Serializable object (name = com.halcyon.ui.redbumper.entities.RBGetVehicleInfoByVin_AllTrims)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Parcel.readSerializable(Parcel.java:1951)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Parcel.readValue(Parcel.java:1822)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Parcel.readMapInternal(Parcel.java:2008)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Bundle.unparcel(Bundle.java:208)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Bundle.getString(Bundle.java:1034)
03-19 15:39:02.549: E/AndroidRuntime(27084): at com.adplotmanagement.androidScrolbleTabbar$PUSHViewBroadcastReceiver.onReceive(androidScrolbleTabbar.java:560)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:910)
03-19 15:39:02.549: E/AndroidRuntime(27084): ... 9 more
03-19 15:39:02.549: E/AndroidRuntime(27084): Caused by: java.lang.ClassNotFoundException: com.halcyon.ui.redbumper.entities.RBGetVehicleInfoByVin_AllTrims
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.lang.Class.classForName(Native Method)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.lang.Class.forName(Class.java:235)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2590)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1846)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:826)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2066)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:929)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2285)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2240)
03-19 15:39:02.549: E/AndroidRuntime(27084): at android.os.Parcel.readSerializable(Parcel.java:1945)
03-19 15:39:02.549: E/AndroidRuntime(27084): ... 15 more
03-19 15:39:02.549: E/AndroidRuntime(27084): Caused by: java.lang.NoClassDefFoundError: com.halcyon.ui.redbumper.entities.RBGetVehicleInfoByVin_AllTrims
03-19 15:39:02.549: E/AndroidRuntime(27084): ... 25 more
03-19 15:39:02.549: E/AndroidRuntime(27084): Caused by: java.lang.ClassNotFoundException: com.halcyon.ui.redbumper.entities.RBGetVehicleInfoByVin_AllTrims in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.adplotmanagement-1.apk]
03-19 15:39:02.549: E/AndroidRuntime(27084): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
03-19 15:39:02.549: E/AndroidRuntime(27084): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
03-19 15:39:02.549: E/AndroidRuntime(27084): ... 25 more
Missed adding one more point, I have two applications with same functionality and each app having the same class GetVehicleInfo_AllTrims and it is a pojo class. When i run one app in foreground the other app that lives in background is crashing with the above error.
Hi find the root cause of the issue and resolved it .
In two apps we are using same BroadCastReceivers and its intent filters. Due to this issue the runtime not able to find the appropriate receiver for the app.
I modified the intent filters for two apps differently and it is working fine now.
java.lang.ClassNotFoundException: com.halcyon.ui.redbumper.entities.RBGetVehicleInfoByVin_AllTrims
What is the cause of this
The cause of this is exception that the class com.halcyon.ui.redbumper.entities.RBGetVehicleInfoByVin_AllTrims was not found.
how can I fix it?
Make that class available on the application's CLASSPATH.
I have downloaded the sample code for location from
https://code.google.com/p/android-protips-location/
I am trying to run it to see but it always crashes after app launch.
I have checked the manifest but I didnt find anything wrong. Has any one faced similar problem with the above sample code.
Here is the crash log.
03-19 12:06:05.456: D/AndroidRuntime(9185): Shutting down VM 03-19
12:06:05.456: W/dalvikvm(9185): threadid=1: thread exiting with
uncaught exception (group=0x414e62a0) 03-19 12:06:05.503:
E/AndroidRuntime(9185): FATAL EXCEPTION: main 03-19 12:06:05.503:
E/AndroidRuntime(9185): java.lang.RuntimeException: Unable to
instantiate activity
ComponentInfo{com.radioactiveyak.location_best_practices/com.radioactiveyak.location_best_practices.UI.PlaceActivity}:
java.lang.ClassNotFoundException:
com.radioactiveyak.location_best_practices.UI.PlaceActivity 03-19
12:06:05.503: E/AndroidRuntime(9185): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2021)
03-19 12:06:05.503: E/AndroidRuntime(9185): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
03-19 12:06:05.503: E/AndroidRuntime(9185): at
android.app.ActivityThread.access$600(ActivityThread.java:140) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
03-19 12:06:05.503: E/AndroidRuntime(9185): at
android.os.Handler.dispatchMessage(Handler.java:99) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
android.os.Looper.loop(Looper.java:137) 03-19 12:06:05.503:
E/AndroidRuntime(9185): at
android.app.ActivityThread.main(ActivityThread.java:4895) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
java.lang.reflect.Method.invokeNative(Native Method) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
java.lang.reflect.Method.invoke(Method.java:511) 03-19 12:06:05.503:
E/AndroidRuntime(9185): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
03-19 12:06:05.503: E/AndroidRuntime(9185): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
dalvik.system.NativeStart.main(Native Method) 03-19 12:06:05.503:
E/AndroidRuntime(9185): Caused by: java.lang.ClassNotFoundException:
com.radioactiveyak.location_best_practices.UI.PlaceActivity 03-19
12:06:05.503: E/AndroidRuntime(9185): at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
03-19 12:06:05.503: E/AndroidRuntime(9185): at
java.lang.ClassLoader.loadClass(ClassLoader.java:501) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
java.lang.ClassLoader.loadClass(ClassLoader.java:461) 03-19
12:06:05.503: E/AndroidRuntime(9185): at
android.app.Instrumentation.newActivity(Instrumentation.java:1068)
03-19 12:06:05.503: E/AndroidRuntime(9185): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2012)
03-19 12:06:05.503: E/AndroidRuntime(9185): ... 11 more
Did you try project -> Clean? Do you have to add the permision in manifest of location?
I had the same issue.
I solved it by going to: Project Properties -> Java Build Path -> Order and Export Tab
And then ive put the checkmark on the "android-support-v4.jar"