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

Update docs on how to use transformation lib with proguard #282

Closed
SzymonGrochowiak opened this issue May 12, 2023 · 2 comments
Closed

Update docs on how to use transformation lib with proguard #282

SzymonGrochowiak opened this issue May 12, 2023 · 2 comments
Assignees

Comments

@SzymonGrochowiak
Copy link

Hi, I am unsure whether I should create a bug or feature request for this.

Is your feature request related to a problem?

The transformation library is not working with proguard. I used com.github.skydoves:landscapist-transformation:2.1.10 dependency.
Using proguard causes crash:

Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for long J5.a.b() (tried Java_J5_a_b and Java_J5_a_b__)
       at com.skydoves.landscapist.transformation.RenderScriptToolkit.createNative(RenderScriptToolkit.java)
       at com.skydoves.landscapist.transformation.RenderScriptToolkit.<clinit>(RenderScriptToolkit.java:12)
       at com.skydoves.landscapist.transformation.blur.RememberBlurPainterKt.iterativeBlur(RememberBlurPainter.kt:89)
       at com.skydoves.landscapist.transformation.blur.RememberBlurPainterKt.access$iterativeBlur(RememberBlurPainter.kt:89)
       at com.skydoves.landscapist.transformation.blur.RememberBlurPainterKt.rememberBlurPainter(RememberBlurPainter.kt:89)
       at com.skydoves.landscapist.transformation.blur.BlurTransformationPlugin.compose(BlurTransformationPlugin.java:89)
       at com.skydoves.landscapist.plugins.ImagePluginKt.composePainterPlugins(ImagePlugin.kt:56)
       at com.skydoves.landscapist.RememberPainterPluginsKt.rememberDrawablePainter(RememberPainterPlugins.kt:6)
       at com.skydoves.landscapist.glide.GlideImage__GlideImageKt$GlideImage$5.invoke(GlideImage__GlideImage.kt:6)
       at com.skydoves.landscapist.glide.GlideImage__GlideImageKt$GlideImage$5.invoke(GlideImage__GlideImage.kt:6)
       at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambdaImpl.java:50)
       at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambdaImpl.java:8)
       at com.skydoves.landscapist.ImageLoad__ImageLoadKt$ImageLoad$2.invoke(ImageLoad__ImageLoad.kt:122)
       at com.skydoves.landscapist.ImageLoad__ImageLoadKt$ImageLoad$2.invoke(ImageLoad__ImageLoad.kt:122)
       at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambdaImpl.java:50)
       at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambdaImpl.java:21)
       at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambdaImpl.java:21)
       at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.java:14)
       at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(ComposerImpl.java:189)
       at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(ComposerImpl.java:46)
       at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(ComposerImpl.java:71)
       at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(ComposerImpl.java:71)
       at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(SnapshotStateKt__DerivedState.kt:41)
       at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(SnapshotState.kt:130)
       at androidx.compose.runtime.ComposerImpl.doCompose(ComposerImpl.java:130)
       at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(ComposerImpl.java:32)
       at androidx.compose.runtime.CompositionImpl.recompose(CompositionImpl.java:18)
       at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.java:68)
       at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.java:68)
       at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.java:378)
       at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.java:378)
       at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.java:6)
       at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.java:34)
       at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.java:34)
       at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.java:12)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:977)
       at android.view.Choreographer.doCallbacks(Choreographer.java:791)
       at android.view.Choreographer.doFrame(Choreographer.java:723)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:965)
       at android.os.Handler.handleCallback(Handler.java:789)
       at android.os.Handler.dispatchMessage(Handler.java:98)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6759)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)

Describe the solution you'd like:

Provide clear instructions on how to set proguard rules for the transformations library. In my case, I excluded all classes in proguard file: -keep class com.skydoves.landscapist.transformation.** { *; } and it worked. Crash no longer occurs.

@SzymonGrochowiak SzymonGrochowiak changed the title Update docs on using how to use transformation lib with proguard Update docs on how to use transformation lib with proguard May 12, 2023
@skydoves
Copy link
Owner

@SzymonGrochowiak Thanks for reporting this issue! I will work on automatically includes this proguard in the next release.

@skydoves
Copy link
Owner

@SzymonGrochowiak This has been included in version 2.2.0. Thanks for reporting this issue!

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

2 participants