ShowcaseView
ShowcaseView copied to clipboard
Crazy amounts of crashes .updateBitmap IllegalArgumentException
I just integrated Showcaseview again after a two year hiatus and am regretting it...
It works fine on my test devices but numerous users are getting crashes and the stacktrace is from the library at:
Fatal Exception: java.lang.IllegalArgumentException width and height must be > 0 com.github.amlcurran.showcaseview.ShowcaseView.updateBitmap (ShowcaseView.java:211) com.github.amlcurran.showcaseview.ShowcaseView.access$100 (ShowcaseView.java:51) com.github.amlcurran.showcaseview.ShowcaseView$1.run (ShowcaseView.java:187)
ShowcaseView is being run 5 seconds after launch (so the view is definitely created) and I'm targeting a point, not a specific view (just in case).
I searched the web and found a few things here and there, most of the responses were not helpful. Currently the only solution I have is calling the showcase a single time (therefore it will always work on the second launch).
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
new ShowcaseView.Builder(MainActivity.this)
.setTarget(new PointTarget(250, 350))
.setContentTitle(getString(R.string.showcase_title))
.setContentText(getString(R.string.showcase_description))
.singleShot(125)
.setStyle(R.style.CustomShowcaseTheme)
.build();
}
}, 5000);
}
Agree, got the same issue
exact same error here
I figured out the problem. I was launching a tutorial first and this would trigger at the same time. Because the tutorial was visible first, this would cause a crash. Explicitly calling it AFTER the tutorial will prevent the crash.
got the same issue
just had the same issue in my app.
I've targeted a textview in the first row of a recyclerView via the onBindViewHolder (just to see if it would work)
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
[...]
if(i == 0){
Log.d(TAG,"showHelp from onBindViewHolder");
showHelp(viewHolder.tv_verify_list_billed);
}
private void showHelp(View view){
if(view == null){
Log.d(TAG,"showHelp view was null");
return;
}
ViewTarget vt = new ViewTarget(view);
new ShowcaseView.Builder(getActivity())
.setTarget(vt)
.setContentTitle(getString(R.string.list_title))
.setContentText(getString(R.string.list_content))
.setStyle(R.style.CustomShowcaseTheme)
.hideOnTouchOutside()
.replaceEndButton(R.layout.showcase_button)
//.singleShot(ShowcaseView_SSIDs.InventoryList.hashCode())
.build();
}
it works perfectly on first load of the recyclerView list, but when i swipeRefresh the recyclerView i get the error.
Hopefully this helps to reproduce it for bug fixing.
java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:934)
at android.graphics.Bitmap.createBitmap(Bitmap.java:913)
at android.graphics.Bitmap.createBitmap(Bitmap.java:880)
at com.github.amlcurran.showcaseview.ShowcaseView.updateBitmap(ShowcaseView.java:211)
at com.github.amlcurran.showcaseview.ShowcaseView.access$100(ShowcaseView.java:51)
at com.github.amlcurran.showcaseview.ShowcaseView$1.run(ShowcaseView.java:187)
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:6872)
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:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Interesting, thanks for the reproduction steps. I'd imagine that this isn't exactly how best to use showcaseview with a RecyclerView but will take a look and report back!
@easycheese can you tell me what devices are having the issue?
@amlcurran as far as I can tell it will happen on any device
I have the same issue
Any idea to fix this?
@Fornori Can you give me more details of what you're? I have no way of reproducing this right now because I'm not sure what is happening. Any code that reproduces the crash will be great
Sorry, but code was gone. I replaced it by another. And now can't reproduce. If the app will crash again. I will write full description.
Same problem here
I believe this is a duplicate of https://github.com/amlcurran/ShowcaseView/issues/197, which should be fixed in com.github.amlcurran.showcaseview:library:5.4.3
.