Android Emulator: Unfortunately Launcher has stopped - android

Since the last update of my Android Studio and my SDK packages, I get this error whenever I start the emulator. Please check the screen shot below.
My logcat reports these as error statement:
06-11 05:18:22.906 15313-15328/com.android.launcher E/dalvikvm-heap﹕ Out of memory on a 88955584-byte allocation.
06-11 05:18:22.956 15313-15328/com.android.launcher E/AndroidRuntime﹕ FATAL EXCEPTION: launcher-loader
Process: com.android.launcher, PID: 15313
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:840)
at android.content.res.Resources.loadDrawable(Resources.java:2115)
at android.content.res.Resources.getDrawableForDensity(Resources.java:755)
at com.android.launcher2.IconCache.getFullResIcon(IconCache.java:74)
at com.android.launcher2.IconCache.getFullResIcon(IconCache.java:113)
at com.android.launcher2.IconCache.getFullResIcon(IconCache.java:98)
at com.android.launcher2.IconCache.cacheLocked(IconCache.java:213)
at com.android.launcher2.IconCache.getTitleAndIcon(IconCache.java:155)
at com.android.launcher2.ApplicationInfo.<init>(ApplicationInfo.java:88)
at com.android.launcher2.LauncherModel$LoaderTask.loadAllAppsByBatch(LauncherModel.java:1928)
at com.android.launcher2.LauncherModel$LoaderTask.loadAndBindAllApps(LauncherModel.java:1820)
at com.android.launcher2.LauncherModel$LoaderTask.run(LauncherModel.java:1134)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
The things I have tried out:
1. Deleted the emulator and created it fresh.
2. I found some answers on StackOverFlow talking about Hardware keys. did that too.

I had the same problem
the problem was I use image on drawable that not support different
screen sizes as app icon so I changed to default icon of android studio and rebuilded the app and it now working
enter image description here

Related

Android TaskView produces ClassCastException

My grandfather is proud owner of a Samsung Galaxy Ace 2. He now told me that whenever he presses the home-button long to open the task view he gets an error "Unfortunately, System UI has stopped"
I know investigated on this and tried to reproduce the error while being connected to the android monitor to get a more specific error message.
The error message looks like the following:
01-22 12:44:42.450 4978-4978/? E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ClassCastException: android.graphics.drawable.StateListDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
at com.android.systemui.recent.RecentsPanelView.replaceGoogleButtonTo3rdAppTextAndIcon(RecentsPanelView.java:1444)
at com.android.systemui.recent.RecentsPanelView.replaceGoogleButtonTextAndIcon(RecentsPanelView.java:1392)
at com.android.systemui.recent.RecentsPanelView.show(RecentsPanelView.java:461)
at com.android.systemui.recent.RecentsPanelView.showIfReady(RecentsPanelView.java:391)
at com.android.systemui.recent.RecentsPanelView.onTasksLoaded(RecentsPanelView.java:1015)
at com.android.systemui.recent.RecentTasksLoader$1.onProgressUpdate(RecentTasksLoader.java:292)
at com.android.systemui.recent.RecentTasksLoader$1.onProgressUpdate(RecentTasksLoader.java:285)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:647)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4867)
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:1007)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
at dalvik.system.NativeStart.main(Native Method)
01-22 12:44:42.460 1988-2005/? E/android.os.Debug: !#Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error
There is no custom rom installed or any other custom application. The latest updates already are installed. After searching the web, I did a wipe of the cache in the recovery menu also I made a full reset of the mobile phone. Nothin helped by now.
Maybe some of you may have an idea on what to investigate any further?

Couldn't load alljoyn_java from loader dalvik.system

i am creating a chat application by using Alljoyn framework and am getting the following error can somebody please help me. The alljoyn jars are already set up!!!
FATAL EXCEPTION: main
Process: com.example.vikesh.chat_application, PID: 4326
java.lang.UnsatisfiedLinkError: Couldn't load alljoyn_java from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.vikesh.chat_application-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.vikesh.chat_application-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.example.vikesh.chat_application.AlljoynService.<clinit>(AlljoynService.java:1252)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2553)
at android.app.ActivityThread.access$1800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
You need to put the AllJoyn liballjoyn_java.so file within your project.
For example, in Android Studio, the usual location for this file is:
[your_project_dir]/app/src/main/jniLibs/armeabi/
The armeabi portion of the above path is assuming that the AllJoyn .so file that you have previously built is targeted for the 'arm' CPU (the armeabi instruction set).
Note: When I deleted the .so file from my app, I got the same error that you are reporting. When I put the .so file back I still got the same error. I had to uninstall the app from my Android device, and in Android Studio I had to clean and rebuild the app, before I was able to get past this error.
Some other things to consider...
Make sure in your App that you are calling
static {
System.loadLibrary("alljoyn_java");
}
Make sure that the liballjoyn_java.so you previously built matches the cpu instruction set of your Android device. You can verify your Android's instruction set by using an app such as Droid Info, for example. Assuming that it is armeabi, then when you build the AllJoyn core project, you need to specify at a minimum the following switches in your scons build command....
scons BINDINGS="cpp,java,c" OS=android CPU=arm VARIANT=release
Finally, the following Stackoverflow link discusses general reasons the error you are seeing can occur:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader

Out memory error

Hi i have been doing a project from school and when i ran my application i have the stack trace error shown below.
03-06 14:58:02.520 11265-11265/com.example.ray.cdmsv2 E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.OutOfMemoryError
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:832)
at android.content.res.Resources.loadDrawable(Resources.java:2988)
at android.content.res.Resources.getDrawable(Resources.java:1558)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:937)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:873)
at android.content.res.Resources.loadDrawable(Resources.java:2970)
at android.content.res.Resources.getDrawable(Resources.java:1558)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:323)
at android.support.v7.widget.TintManager.getDrawable(TintManager.java:147)
at android.support.design.widget.TabLayout$Tab.setIcon(TabLayout.java:1080)
at com.example.ray.cdmsv2.Activities.CreateTaskActivity.onCreate(CreateTaskActivity.java:102)
at android.app.Activity.performCreate(Activity.java:5372)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2362)
at android.app.ActivityThread.access$700(ActivityThread.java:168)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5493)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
I have looked around for solution but i still cannot resolve the issue. My application is able to run smoothly on Samsung Galaxy A3. However when i tried to run my application on a S4 and Note 4 i receive the out of memory error. I have realized that when i implement some selector in my drawable which i call in my XML files, it will cause the error, however when i remove it the error does not occur anymore. Is there any explanation for this issue? Thank you very much for helping me out
Delete the drawable and import it again using ImageAsset option.
The error is your image is too heavy for loading it into memory. Or better compress the image before copying it into the Drawable folder.
I would start by learning some best practices for memory usage by google at the dev docs #
http://developer.android.com/training/displaying-bitmaps/index.html
If you're loading large bitmaps, its quite possible the available heap memory is not enough for your bitmaps.
Your app is being choked by Android because it is using more memory than assigned, primarily due to a large image file being used as a drawable.
If it is an icon, use Android Studio's built in Image Asset generator to generate appropriate image sizes for each display type (mdpi,hdpi,xhdpi,xxhdpi and so on). If it is an image being loaded on an ImageView, you may try using the Picasso library which will handle bitmap memory on its own.

Need Stacktrace error logs from Debug Android App without Google Play

I need the Error logs with stack trace from my users with my Android App (Debug, deployed via DeployGate). I've tried DeployGate SDK and RemoteLogCat. RemoteLogCat and DeployGate only send Log messages that I've put in myself, but I need the current LogCat data (as if it would be hooked up to my own PC) with LogLevel "Error".
This is what I need:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: www.myapp.nl.simpelfragmentvoorbeeld, PID: 5020
java.lang.RuntimeException: NullPointerException
at www.myapp.nl.MainActivity$1.onClick(MainActivity.java:87)
at android.view.View.performClick(View.java:5197)
at android.view.View$PerformClick.run(View.java:20926)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5944)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.
run(ZygoteInit.java:1389)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
Many thanks guys!
The solution is using ACRA
ACRA is a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. It is targetted to android applications developers to help them get data from their applications when they crash or behave erroneously.

I've problems with "sinch app to app messaging" on my phone

I wanna implement sinch app to app instant messaging funcitionality to my existing app. I followed github and tutorials I added sdks to my library. I can run my app on emulator. I can login and sign up and send messaging to another account which I also created on emulator. But when I try to run my app on real phone, i've faced with problems. When I click the login and sign up button, my app has stopped. After I rerun my project on emulator, I realized that I was able to sign up on my phone. When I enter my app again, it has crushed. Briefly, my app works on emulator but not on real phone now. I need your help, please help me!!
Below is my logcat.
09-24 17:06:16.991 17061-17061/com.meliksah.cakir.buec E/art﹕ dlopen("/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so", RTLD_LAZY) failed: dlopen failed: "/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so" is too small to be an ELF executable: only found 0 bytes
09-24 17:06:16.991 17061-17061/com.meliksah.cakir.buec D/AndroidRuntime﹕ Shutting down VM
09-24 17:06:16.991 17061-17061/com.meliksah.cakir.buec E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.meliksah.cakir.buec, PID: 17061
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so" is too small to be an ELF executable: only found 0 bytes
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:989)
at com.sinch.android.rtc.internal.client.DefaultSinchClient.<clinit>(DefaultSinchClient.java:72)
at com.sinch.android.rtc.internal.client.InternalSinchClientFactory.createSinchClient(InternalSinchClientFactory.java:17)
at com.sinch.android.rtc.DefaultSinchClientBuilder.build(DefaultSinchClientBuilder.java:95)
at com.meliksah.cakir.buec.MessageService.startSinchClient(MessageService.java:48)
at com.meliksah.cakir.buec.MessageService.onStartCommand(MessageService.java:39)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3307)
at android.app.ActivityThread.access$2200(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
This error:
dlopen failed: "/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so" \
is too small to be an ELF executable: only found 0 bytes
means that you have a zero-length file with above path.
Either you made a mistake while copying it to your phone, or something truncates it after it's copied. Fixing that problem is almost definitely the required first step in getting your application working.

Categories

Resources