So I just released a new beta today with no changes to this piece of code. Strangely enough I got a new crash I've never seen before reported on Crashlytics. It has only happened to 2 users from two different manufacturers on Android 6 and 7. So it isn't a huge deal yet but I would still like to get it fixed.
Anyone have any idea what might be the issue here?
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
at android.content.res.AssetManager.getResourceValue(AssetManager.java:206)
at android.content.res.Resources.getValue(Resources.java:1540)
at android.content.res.Resources.getDrawable(Resources.java:918)
at android.content.Context.getDrawable(Context.java:463)
at android.support.v4.content.ContextCompatApi21.getDrawable(ContextCompatApi21.java:30)
at android.support.v4.content.ContextCompat.getDrawable(ContextCompat.java:372)
Thanks.
Here is the code that causes the issue:
#Override
public Drawable getDefaultPlaceholderImage() {
return ContextCompat.getDrawable(this, R.drawable.default_placeholder);
}
I have the similar crashes at some devices (Samsung GT-I9505, Android 5). The error happens while parsing xml of the image. The cause of the error is the number with two points in the xml (it was "1.84.63" in my xml). Try to create all xml of images by another converter (for example, Vector Asset Studio).
Related
So, I have this android application and even some users. As I have a crash report system, I can see when someone's app crashes and the cause.
It appears that, though rarely, the app crashes randomly with NullPointerException when it tries to change some attributes(rotation, text, etc..). I make sure everything is set first thing in the onViewCreated method(using Fragments) like this:
private TextView orientationView;
orientationView = this.getActivity().findViewById(R.id.orientationView);
Using this ^^ example, I then try to hide/show this view and get an exception as it appears to be null sometimes, which is what I struggle to figure out why.
orientationView.setVisibility(View.VISIBLE); // app crashes when orientationView is null
Being a newbie in android development, I am not sure if it is a good practice, but in some of the fragments, I set all the previously initialized resources to null in the onDestroyView method, but the one that crashes the most doesn't have this method implemented, which make me to believe that somehow the resources are just not found/initialized in some rare occasions and I fail to change them later with an exception.
Could someone help me figure this out :) (more description could be provided, if needed)
I'm facing a very annoying android crash that happens in around 1% of PRODUCTION the sessions with the app ALWAYS in the background.
Fatal Exception: android.app.RemoteServiceException: Attempt to invoke virtual method 'int com.android.server.wm.TaskDisplayArea.getDisplayId()' on a null object reference
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2054)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:250)
at android.app.ActivityThread.main(ActivityThread.java:7755)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
From this stack is clear that it comes from an internal android MainLooper operation... but the lack of extra information difficult for me to discover WHAT exactly
does anyone know what is this problem and how to solve it?
There's not a whole lot we can do with this level of information. The only thing I can see is this:
android.app.RemoteServiceException: Attempt to invoke virtual method 'int com.android.server.wm.TaskDisplayArea.getDisplayId()' on a null object reference
At some stage, your code is calling (or using a library which calls) getTaskDisplayArea() in com.android.server.wm. This returns null. It then tries to use this to getDisplayId().
(The rest of the error lines there just indicate it's not in the main thread)
It's likely that wherever you're using the TaskDisplayArea (or the library that calls it) is being called when the UI has been destroyed or has yet to be created.
The rarity indicates it probably is a total background restart of your UI/display elements... if I had to guess maybe caused by Android OS memory cleanup triggers while multitasking, or the user changing orientation repeatedly, etc etc.
If you give more details about where you've used the com.android.server.wm code or layouts you can probably get more help for how to make this background-thread-proof. Depending on what you're actually doing you might end up just catching the exception & retrying later, but some views will allow you to post info to the main thread and I don't know if TaskDisplayArea does.
In my case, I found that the project had a notification icon file in res/drawable-v24/ic_launcher_foreground.xml. The crashing stopped when I moved the .xml associated with v24 in the drawable res folder.
I have developed app using codename one.It was working fine initially.but since 3-4 days getting issues.When I clicked on Menu Item it giving below error
an internal application error occurred:java.lang.NullPointerException:Attempt to invoke virtual method'void com.codename1.o.al.bj() on null object refference
Iniially every thing was working fine but since 3-4 days it giving issues like that.
Please help me to solve this issue?
Thanks in advance.
I have submited an issue last Friday. This is due to the last update and will be fixed on the next update (next Friday). You can workaround it by disabling the on top side menu for now with: yourForm.getToolbar().setOnTopSideMenu(false);
We can not analyse what went wrong, because error is a generic "Null Pointer Exception". We need to know complete functionality and what different behaviour happened. Please provide us with some more details if possible.
I am getting a crash on Android Lolipop.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
at android.content.res.AssetManager.getResourceValue(AssetManager.java:213)
at android.content.res.Resources.getValue(Resources.java:1334)
at android.content.res.Resources.getValue(Resources.java:1323)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2796)
at android.content.res.Resources.getLayout(Resources.java:1143)
at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
Generally happens while inflating a view.
Any suggestions why it happens on Lollipop only ?
It is may be because of an attribute is null.
For example android:foreground="?android:attr/selectableItemBackground" may be null, try to use android:foreground="?attr/selectableItemBackground".
In my case it occurred when I was setting a image to notification from service . I remove the relevant code and it started working fine
I cant even get the example working for this, it throws the following error
02-04 19:22:05.617: E/AndroidRuntime(2548): java.lang.IllegalArgumentException: Supplied pTextureAtlasSource must not exceed bounds of Texture.
Does anyone know how to fix this or what it mean? This is just the example program that I installed
Ok, anyone that has this issue...
First of all that error was not correct, I seemed to have an older version of the AndEngine that was throwing that error. Also the example that is provided is flawed
Although it spcifies the base folder is "gfx" this doesnt apply for TexturePacket Textures therefore the path for the object should be "gfx/spritesheet/". I discovered this after it started to throw a null pointer exception after updating the engine