Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When Building against API 28, Proguard Error is observed #921

Open
MattWilliams89 opened this issue Jul 4, 2018 · 9 comments
Open

When Building against API 28, Proguard Error is observed #921

MattWilliams89 opened this issue Jul 4, 2018 · 9 comments

Comments

@MattWilliams89
Copy link

When building against API 28 (targetSDK and compileSDK), the following proguard error is observed.

Warning: com.sothree.slidinguppanel.SlidingUpPanelLayout: can't find referenced method 'int save(int)' in library class android.graphics.Canvas

@alt236
Copy link

alt236 commented Jul 6, 2018

The issue is caused by this line:

        final int save = canvas.save(Canvas.CLIP_SAVE_FLAG);

CLIP_SAVE_FLAG has been pruned in P, along with the parametarized save() method.

src: https://developer.android.com/sdk/api_diff/28/changes/android.graphics.Canvas

@alt236
Copy link

alt236 commented Jul 6, 2018

I have a (not very pretty due to reflection) fix here: #922

@Sottti
Copy link

Sottti commented Aug 9, 2018

As a workaround, this works for me.

-dontwarn com.sothree.**
-keep class com.sothree.**
-keep interface com.sothree.**

@owlstack
Copy link

As a workaround, this works for me.

-dontwarn com.sothree.**
-keep class com.sothree.**
-keep interface com.sothree.**

Sorry for ignorant question but where do I put this? In build.gradle? Thanks!

@drivardST
Copy link

As a workaround, this works for me.

-dontwarn com.sothree.**
-keep class com.sothree.**
-keep interface com.sothree.**

Sorry for ignorant question but where do I put this? In build.gradle? Thanks!

Put it in your proguard file

@ecexplorer
Copy link

I'm curious if anyone else has had luck with quick workarounds while trying to move off of this unmaintained library.
Trying the above progaurd recommendation did not fix the issue for me.
Additionally, the commits referenced by @FatihYalmanbas did work, but failed to render the view onto the expanded layout.
It seems the current way to do this in android is using BottomSheetBehavior (https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior)

@Chinmay12112
Copy link

As a workaround, this works for me.

-dontwarn com.sothree.**
-keep class com.sothree.**
-keep interface com.sothree.**

Sorry for ignorant question but where do I put this? In build.gradle? Thanks!

Put it in your proguard file

Can u help me here I am still getting the error

"
cloneeeee
error: cannot find symbol variable CLIP_SAVE_FLAG"
check the file i attached

@drivardST
Copy link

The proguard stuff is for the save method, not CLIP_SAVE_FLAG. It's gone, you need to find an alternative.

Read this stack overflow

https://stackoverflow.com/questions/54148443/can-not-find-canvas-variables-in-api-level-28

@JoseGD
Copy link

JoseGD commented Nov 28, 2019

I'm curious if anyone else has had luck with quick workarounds while trying to move off of this unmaintained library.
Trying the above progaurd recommendation did not fix the issue for me.
Additionally, the commits referenced by @FatihYalmanbas did work, but failed to render the view onto the expanded layout.
It seems the current way to do this in android is using BottomSheetBehavior (https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior)

This quick workaround worked for me:
-dontwarn android.graphics.Canvas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants