I'm using ActionShrelockBar & libslidemenu library.
The slide menu work's fine for 2.3 to 4.2.
But when i tried it in 4.3 latest version of android the slidemenu crashes .
I tried by adding support library but no go.
07-26 02:04:14.400: E/AndroidRuntime(785): FATAL EXCEPTION: main
07-26 02:04:14.400: E/AndroidRuntime(785): java.lang.ClassCastException: com.android.internal.widget.ActionBarOverlayLayout cannot be cast to android.widget.FrameLayout
07-26 02:04:14.400: E/AndroidRuntime(785): at com.coboltforge.slidemenu.SlideMenu.show(SlideMenu.java:317)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.coboltforge.slidemenu.SlideMenu.show(SlideMenu.java:260)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.hrh.lba.fragments.CategoryFragment.onOptionsItemSelected(CategoryFragment.java:326)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.support.v4.app.Watson.onMenuItemSelected(Watson.java:127)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.actionbarsherlock.ActionBarSherlock.callbackOptionsItemSelected(ActionBarSherlock.java:603)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchOptionsItemSelected(ActionBarSherlockNative.java:78)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.actionbarsherlock.app.SherlockFragmentActivity.onMenuItemSelected(SherlockFragmentActivity.java:205)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.android.internal.widget.ActionBarView$3.onClick(ActionBarView.java:171)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.view.View.performClick(View.java:4240)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.view.View$PerformClick.run(View.java:17721)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.os.Handler.handleCallback(Handler.java:730)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.os.Handler.dispatchMessage(Handler.java:92)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.os.Looper.loop(Looper.java:137)
07-26 02:04:14.400: E/AndroidRuntime(785): at android.app.ActivityThread.main(ActivityThread.java:5103)
07-26 02:04:14.400: E/AndroidRuntime(785): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 02:04:14.400: E/AndroidRuntime(785): at java.lang.reflect.Method.invoke(Method.java:525)
07-26 02:04:14.400: E/AndroidRuntime(785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
Tried with this patch .
And it's working great for 4.3 now .
Patch
The key is in the first string:
com.android.internal.widget.ActionBarOverlayLayout cannot be cast to
android.widget.FrameLayout
Check source of SlideMenu.java at line 317
There must be some changes to SDK, so that you don't get expected class there.
Related
Just bought PhoneGap 2.x Mobile Application Development Hotshot book to improve my knowledge working with PhoneGap and try to run some apps from the book. I downloaded whose apps from their github repository (https://github.com/photokandyStudios/PhoneGap-HotShot-Book-Code-Bundle) and, for example, tried to run first app from Chapter1 (QuizApp). Imported that whole folder with Eclipse(Import > Existing Android Code Into Workspace) and when I try to run it on my emulator or on my real Android device, it just stops working and shuts down. Looks like everything is in their right places, but nothing.
Here I will provide my LogCat information:
07-26 15:24:51.418: E/Trace(853): error opening trace file: No such file or directory (2)
07-26 15:24:51.688: W/dalvikvm(853): Unable to resolve superclass of Lcom/phonegaphotshot/QuizTime/QuizTime; (15)
07-26 15:24:51.688: W/dalvikvm(853): Link of class 'Lcom/phonegaphotshot/QuizTime/QuizTime;' failed
07-26 15:24:51.718: D/AndroidRuntime(853): Shutting down VM
07-26 15:24:51.718: W/dalvikvm(853): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
07-26 15:24:51.798: E/AndroidRuntime(853): FATAL EXCEPTION: main
07-26 15:24:51.798: E/AndroidRuntime(853): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.phonegaphotshot.QuizTime/com.phonegaphotshot.QuizTime.QuizTime}: java.lang.ClassNotFoundException: com.phonegaphotshot.QuizTime.QuizTime
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.ActivityThread.access$600(ActivityThread.java:130)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.os.Looper.loop(Looper.java:137)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.ActivityThread.main(ActivityThread.java:4745)
07-26 15:24:51.798: E/AndroidRuntime(853): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 15:24:51.798: E/AndroidRuntime(853): at java.lang.reflect.Method.invoke(Method.java:511)
07-26 15:24:51.798: E/AndroidRuntime(853): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-26 15:24:51.798: E/AndroidRuntime(853): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-26 15:24:51.798: E/AndroidRuntime(853): at dalvik.system.NativeStart.main(Native Method)
07-26 15:24:51.798: E/AndroidRuntime(853): Caused by: java.lang.ClassNotFoundException: com.phonegaphotshot.QuizTime.QuizTime
07-26 15:24:51.798: E/AndroidRuntime(853): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
07-26 15:24:51.798: E/AndroidRuntime(853): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-26 15:24:51.798: E/AndroidRuntime(853): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
07-26 15:24:51.798: E/AndroidRuntime(853): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
07-26 15:24:51.798: E/AndroidRuntime(853): ... 11 more
Thanks for any help
Solved it! If someone having similar problem, just do this step by step:
Right click on Cordovaxxx.jar -> Configure Build Path in Tab Order and Export and make sure these ones are selected:
1. Android (in my case was Adnroid 4.1.2)
2. Android Dependencies
3. Cordova....
4. ..../src
5. ..../gen
I am trying to integrate the MuPDF jar in my project but after integrating and running my app I'm getting the above exception. These are my crash logs in the logcat:
07-26 16:26:18.608: W/dalvikvm(27233): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/artifex/mupdfdemo/MuPDFCore;
07-26 16:11:49.328: E/AndroidRuntime(25410): FATAL EXCEPTION: main
07-26 16:11:49.328: E/AndroidRuntime(25410): java.lang.ExceptionInInitializerError
07-26 16:11:49.328: E/AndroidRuntime(25410): at com.artifex.mupdfdemo.MuPDFActivity.openFile(MuPDFActivity.java:209)
07-26 16:11:49.328: E/AndroidRuntime(25410): at com.artifex.mupdfdemo.MuPDFActivity.onCreate(MuPDFActivity.java:306)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.os.Looper.loop(Looper.java:123)
07-26 16:11:49.328: E/AndroidRuntime(25410): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-26 16:11:49.328: E/AndroidRuntime(25410): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 16:11:49.328: E/AndroidRuntime(25410): at java.lang.reflect.Method.invoke(Method.java:507)
07-26 16:11:49.328: E/AndroidRuntime(25410): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-26 16:11:49.328: E/AndroidRuntime(25410): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-26 16:11:49.328: E/AndroidRuntime(25410): at dalvik.system.NativeStart.main(Native Method)
07-26 16:11:49.328: E/AndroidRuntime(25410): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load mupdf: findLibrary returned null
07-26 16:11:49.328: E/AndroidRuntime(25410): at java.lang.Runtime.loadLibrary(Runtime.java:429)
07-26 16:11:49.328: E/AndroidRuntime(25410): at java.lang.System.loadLibrary(System.java:554)
07-26 16:11:49.328: E/AndroidRuntime(25410): at com.artifex.mupdfdemo.MuPDFCore.<clinit>(MuPDFCore.java:14)
07-26 16:11:49.328: E/AndroidRuntime(25410): ... 15 more
I have put the mupdf_4.jar in my libs folder and set it in the Java Build Path as well. Could you please let me know how to solve this problem?
Thank you.
I downloaded google map api v2 sample and followed official tutorial on google website (installed and added google play services) but i got NoClassDefFoundError error when run sample as below
07-26 02:01:04.821: I/Process(620): Sending signal. PID: 620 SIG: 9
07-26 02:01:18.559: W/dalvikvm(682): Unable to resolve superclass of Lcom/example/mapdemo/BasicMapActivity; (80)
07-26 02:01:18.559: W/dalvikvm(682): Link of class 'Lcom/example/mapdemo/BasicMapActivity;' failed
07-26 02:01:18.559: E/dalvikvm(682): Could not find class 'com.example.mapdemo.BasicMapActivity', referenced from method com.example.mapdemo.MainActivity.<clinit>
07-26 02:01:18.559: W/dalvikvm(682): VFY: unable to resolve const-class 128 (Lcom/example/mapdemo/BasicMapActivity;) in Lcom/example/mapdemo/MainActivity;
07-26 02:01:18.559: D/dalvikvm(682): VFY: replacing opcode 0x1c at 0x000d
07-26 02:01:18.658: W/dalvikvm(682): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/example/mapdemo/MainActivity;
07-26 02:01:18.658: W/dalvikvm(682): Class init failed in newInstance call (Lcom/example/mapdemo/MainActivity;)
07-26 02:01:18.676: D/AndroidRuntime(682): Shutting down VM
07-26 02:01:18.676: W/dalvikvm(682): threadid=1: thread exiting with uncaught exception (group=0x40014760)
07-26 02:01:18.791: E/AndroidRuntime(682): FATAL EXCEPTION: main
07-26 02:01:18.791: E/AndroidRuntime(682): java.lang.ExceptionInInitializerError
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.Class.newInstanceImpl(Native Method)
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.Class.newInstance(Class.java:1301)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1663)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1764)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.os.Looper.loop(Looper.java:132)
07-26 02:01:18.791: E/AndroidRuntime(682): at android.app.ActivityThread.main(ActivityThread.java:4025)
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 02:01:18.791: E/AndroidRuntime(682): at java.lang.reflect.Method.invoke(Method.java:491)
07-26 02:01:18.791: E/AndroidRuntime(682): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
07-26 02:01:18.791: E/AndroidRuntime(682): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
07-26 02:01:18.791: E/AndroidRuntime(682): at dalvik.system.NativeStart.main(Native Method)
07-26 02:01:18.791: E/AndroidRuntime(682): Caused by: java.lang.NoClassDefFoundError: com.example.mapdemo.BasicMapActivity
07-26 02:01:18.791: E/AndroidRuntime(682): at com.example.mapdemo.MainActivity.<clinit>(MainActivity.java:100)
07-26 02:01:18.791: E/AndroidRuntime(682): ... 15 more
07-26 02:06:18.960: I/Process(682): Sending signal. PID: 682 SIG: 9
I got google api key by combine SHA 1 fingerprint at "Window > Preferences > Android > Build > SHA 1 fingerprint" with google sample package name "com.example.mapdemo"
Please help me, sorry for my english, thanks very much.
I changed target sdk and emulator is 4.0, that error is disappeared but i got a new is "Google play services is missiong".
Then, i changed target sdk and emulator is 4.2.2, i got error "google play services out of date. requires 3159100 but found 3136130"
Please help me.
Go to "Properties" of the project.
Select "Java Build Path"
Select "Order and Export" Tab
You should see the selected project's "src" and "gen" paths and dependencies here.
The order how they listed were first "src" and then "gen" path
I switch them, so that "gen" folder is build before the "src"
reference https://stackoverflow.com/a/12702315/2398886
Still look at the Properties, instead of switch the positions, try to select all the libs.
I did this and it solves my problem.
Notice: You can run the Map API sample code now, but the Google Map app in emulator still shows nothing. If you want to run this app, you need to install Google Play Service app first.
i have developed an application that works fine on android 2.1 version but when i launch it on android 4.0 version it does not run and throws the stack trace like this:
09-26 19:45:10.961: E/AndroidRuntime(785): FATAL EXCEPTION: main
09-26 19:45:10.961: E/AndroidRuntime(785): java.lang.OutOfMemoryError
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.Bitmap.nativeCreate(Native Method)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.content.res.Resources.loadDrawable(Resources.java:1937)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.content.res.Resources.getDrawable(Resources.java:664)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.widget.ImageView.resolveUri(ImageView.java:542)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.widget.ImageView.setImageResource(ImageView.java:315)
09-26 19:45:10.961: E/AndroidRuntime(785): at com.deedatech.AnimalsNameForKids.AnimalsNameForKidsActivity.onCreate(AnimalsNameForKidsActivity.java:85)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.Activity.performCreate(Activity.java:4465)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.ActivityThread.access$600(ActivityThread.java:122)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.os.Looper.loop(Looper.java:137)
09-26 19:45:10.961: E/AndroidRuntime(785): at android.app.ActivityThread.main(ActivityThread.java:4340)
09-26 19:45:10.961: E/AndroidRuntime(785): at java.lang.reflect.Method.invokeNative(Native Method)
09-26 19:45:10.961: E/AndroidRuntime(785): at java.lang.reflect.Method.invoke(Method.java:511)
09-26 19:45:10.961: E/AndroidRuntime(785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-26 19:45:10.961: E/AndroidRuntime(785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-26 19:45:10.961: E/AndroidRuntime(785): at dalvik.system.NativeStart.main(Native Method)
i just dont understand why this happens because the same program runs perfect on android 2.1 version but throws outOfMemoryError on 4.0 version. please help if u have some idea..
If you are decoding a Bitmap from the UI thread, there is a risk to get the outOfMemoryError. Try to change your decode stream to an asynTask.
Contrary to what Anis said, decoding yor Bitmap on a different thread will not help you avoid an Out Of Memory (OOM) Error, you're still loading exactly the same amount of data into your application.
You need to either reduce the size of the image you are loading or downsample it so you aren't loading in all of the data, for more information on this take a look at Loading Large Bitmaps Efficiently.
I´m trying to install the ZXing QR capture app for testing but I´m getting the error:
07-26 20:15:22.667: E/AndroidRuntime(29355): FATAL EXCEPTION: main
07-26 20:15:22.667: E/AndroidRuntime(29355): java.lang.ExceptionInInitializerError
07-26 20:15:22.667: E/AndroidRuntime(29355): at java.lang.Class.newInstanceImpl(Native Method)
07-26 20:15:22.667: E/AndroidRuntime(29355): at java.lang.Class.newInstance(Class.java:1319)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.app.ActivityThread.access$600(ActivityThread.java:127)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.os.Handler.dispatchMessage(Handler.java:99)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.os.Looper.loop(Looper.java:137)
07-26 20:15:22.667: E/AndroidRuntime(29355): at android.app.ActivityThread.main(ActivityThread.java:4441)
07-26 20:15:22.667: E/AndroidRuntime(29355): at java.lang.reflect.Method.invokeNative(Native Method)
07-26 20:15:22.667: E/AndroidRuntime(29355): at java.lang.reflect.Method.invoke(Method.java:511)
07-26 20:15:22.667: E/AndroidRuntime(29355): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-26 20:15:22.667: E/AndroidRuntime(29355): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-26 20:15:22.667: E/AndroidRuntime(29355): at dalvik.system.NativeStart.main(Native Method)
07-26 20:15:22.667: E/AndroidRuntime(29355): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
07-26 20:15:22.667: E/AndroidRuntime(29355): at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:107)
07-26 20:15:22.667: E/AndroidRuntime(29355): ... 15 more
Some idea?
You are trying to use code in the core/ library but did not put it into your app. But, you don't even need this code. This is by far the simplest way to add scanning: http://code.google.com/p/zxing/wiki/ScanningViaIntent
Is the class com.google.zxing.ResultMetadataType in your build path?