API 28 Issue
See original GitHub issueHello,
I recently bumped my application to API 28, when launching the application, the following below crashes within the ColorPickerView.
Using these dependencies crash the app implementation ‘com.android.support:design:28.0.0-rc01’ implementation ‘com.android.support:appcompat-v7:28.0.0-rc01’
Going down to API 27 works fine, not sure if the new dependencies once they get out of RC will still cause issues.
08-09 20:23:22.157 8630-8630/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.lossydragon.arduinorgb, PID: 8630
java.lang.IllegalArgumentException: x must be < bitmap.width()
at android.graphics.Bitmap.checkPixelAccess(Bitmap.java:1780)
at android.graphics.Bitmap.getPixel(Bitmap.java:1728)
at com.skydoves.colorpickerpreference.ColorPickerView.getColorFromBitmap(ColorPickerView.java:215)
at com.skydoves.colorpickerpreference.ColorPickerView.setSelectorPoint(ColorPickerView.java:313)
at com.skydoves.colorpickerpreference.ColorPickerView.onFirstLayout(ColorPickerView.java:111)
at com.skydoves.colorpickerpreference.ColorPickerView.access$000(ColorPickerView.java:40)
at com.skydoves.colorpickerpreference.ColorPickerView$1.onGlobalLayout(ColorPickerView.java:102)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:945)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2358)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7184)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Thanks,
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Behavior changes: apps targeting API level 28+
Android 9 (API level 28) introduces a number of changes to the Android system. The following behavior changes apply exclusively to apps that ......
Read more >Fetch not working on Android 9 API 28 · Issue #24627 - GitHub
Bug Report Hello, I'm having an Issue about a HTTP service (the error only in simulator with API 28 (Pie) environment).
Read more >What to use in Android API 28 now that fragments are ...
It's only native fragments that are being deprecated. Use the compatibility library fragments and all will be well.
Read more >App crashes with API 28 on Android 8.0 - Fuse Community
it crashes or it simply wont start on Android 8. I read in the forum that time ago this behaviour was due to...
Read more >Sailfish API 28 benchmarks are especially noisy ... - Issue Tracker
Sailfish API 28 benchmarks are especially noisy. 1. Hotlists Mark as Duplicate ... We may have a problem generally with Sailfish 28 being...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s fixed at version 1.0.5. @acorbin3 Thank you for your contribution!
@skydoves I found the issue:
In the non-zero return statement,
palette.getDrawable()
will return a drawable with the dimensions relative to whatever the display size is. In Android P, the call to.getBitmap()
will return the size of the original bitmap, which is 730×730.You’ll have to interpolate the mapped points, or multiply the points with a scaling factor in the
.getPixel()
call.