https://kotlinlang.org logo
Title
c

Colton Idle

12/21/2021, 2:39 PM
I'm exploring the root cause, but after I upgraded to
org.jetbrains.compose:compose-gradle-plugin:1.0.1-rc2
I now get a crash in release mode (aka R8 enabled) of
java.lang.IllegalAccessError: Method 'void android.view.View.onAnimationEnd()' implementing interface method 'void coil.target.Target.onAnimationEnd()' is not public (declaration of 'androidx.compose.ui.platform.AndroidComposeView'
Anyone else encounter this by chance or know where would be the right place to file. Not sure if it's agp/r8/c4d/coil.
t

Thomas

12/21/2021, 3:35 PM
What version of R8 are you using? Should be fixed in 3.1.33
c

Colton Idle

12/21/2021, 5:20 PM
I don't know what version of R8 I'm using as it's bundled with AGP I thought? Do you know how to specify a version? If so, I'll try that.
t

Thomas

12/21/2021, 5:35 PM
In your top level build.gradle add the following maven URL to the buildscript repositories:
<https://storage.googleapis.com/r8-releases/raw>
Then in the same file add the following to the buildscript dependencies (add it BEFORE the Android gradle plugin):
classpath("com.android.tools:r8:3.1.33")
You can see your current R8 version in the generated mapping file at the top somewhere
c

Colton Idle

12/21/2021, 5:36 PM
lmao
I commented on that issue.
back in october. I don't remember making the comment, but it looks like it was fixed, but broke again?
t

Thomas

12/21/2021, 5:37 PM
As far as I know it did not break again. Check your R8 version
Once you update to Android Gradle Plugin 7.1.0-beta04 (or higher) you can remove the R8 version workaround as that should contain the fix
c

Colton Idle

12/21/2021, 5:42 PM
I always use AGP alpha (as well as compose alpha/beta) and the issue definitely fixed itself because we have a commit that removed explicit r8 version declaration.
and now this started breaking again a few days ago.
so there was def some sort of regression/new issue
t

Thomas

12/21/2021, 5:42 PM
Hmm maybe a newer gradle plugin uses an older R8 version
c

Colton Idle

12/21/2021, 5:42 PM
ever since I moved to compose 1.1.0-rc02 (because of kotlin 1.6.10 support)
I'll keep investigating. My top priority for today is just getting a build that works. I should be able to play around with version combinations later today.
t

Thomas

12/21/2021, 5:43 PM
Can you check the generated mapping (of the bugged app) for the R8 version? That way you know for sure you are using the correct version
c

Colton Idle

12/21/2021, 5:44 PM
You can see your current R8 version in the generated mapping file at the top somewhere (edited)
Trying to find that. I never noticed it before. 1 sec
Bugged looks like: # compiler: R8 # compiler_version: 3.2.10-dev
t

Thomas

12/21/2021, 5:46 PM
It could be that version does not contain the fix
c

Colton Idle

12/21/2021, 5:47 PM
gotcha. alright. trying the versin you said 🤞
t

Thomas

12/21/2021, 5:47 PM
Looks like your version was released on 11 Oct so no fix
You can still use 3.2.x but use a newer one
For example I am using 3.2.22-dev
c

Colton Idle

12/21/2021, 5:48 PM
interesting. I guess I should also mention that I'm stuck on AAGP alpha 3 instead of 6 because 4,5,6 or agp introduced incompat with different plugins (named nav arg plugin)
so maybe AGP alpha6 uses something newer that would've had the fix.
t

Thomas

12/21/2021, 5:49 PM
The newest 3.2.x version is 3.2.35, you could try that one but I don’t know how stable it is
c

Colton Idle

12/21/2021, 5:53 PM
Fuck yeah. It worked! THANK YOU # compiler: R8 # compiler_version: 3.1.34
I'll stick with that version for now I suppose, until I can upgrade AGP, then I'll just piggyback with whatever AGP it ships. Unless you think I should just depend on a stable R8. /shruggie