Status Update
Comments
xa...@google.com <xa...@google.com> #2
uc...@google.com <uc...@google.com>
xa...@google.com <xa...@google.com>
cm...@google.com <cm...@google.com>
cm...@google.com <cm...@google.com> #3
Our team is also running into this because we use kotlin reflection to set up mock data for previews.
Can you suggest any workaround that we can apply locally to make layout lib include kotlin reflect until it is officially fixed? We are obviously including it as a build dependency but the layout lib preview doesn't pick it up for some reason.
cm...@google.com <cm...@google.com> #4
I do not see this issue in Electric Eel Beta 4, but I do see it in Flamingo Canary 6.
cm...@google.com <cm...@google.com> #5
I do not see this issue in Electric Eel Beta 4, but I do see it in Flamingo Canary 6.
Is it with the very same project? I'm trying to rule out whether this is related to specific library/compiler versions.
Thanks!
st...@seatgeek.com <st...@seatgeek.com> #6
Yes, that was with the same project. I can double check with the latest versions of each IDE and get back to you though.
cm...@google.com <cm...@google.com> #7
Correction: I was either mistaken before, or behavior has changed, but I am now getting the KotlinReflectionNotSupportedError
issue for IDE compose previews in both EE Beta 5 and Flamingo Canary 8.
Kotlin 1.6.21 AGP 7.3
ga...@gmail.com <ga...@gmail.com> #8
cm...@google.com <cm...@google.com> #9
ga...@gmail.com <ga...@gmail.com> #10
Diego, this looks to be the same problem as
ga...@gmail.com <ga...@gmail.com> #11
This looks to be the same as
cm...@google.com <cm...@google.com> #12
I'm pretty sure the failure is in locating kotlin.reflect.jvm.internal.ReflectionFactoryImpl
in
That Class.forName
should redirect to the "renamed" version that we move in the classpath to the layoutlib.internal so it loads the correct JVM version in
Description
Version of Gradle Plugin: 4.1.0-beta02
Version of Gradle: 6.5
Version of Java: 8
OS: OSX
Steps to Reproduce:
1. Add a buildConfigField that is of type String[] with empty array
buildConfigField "String[]", "ADDITIONAL_OAUTH_SCOPES", "new String[]{}"
2. ./gradlew :app:assemble
2. Notice compilation failure:
/Users/stephen/workspace/BuildConfigBug/app/build/generated/source/buildConfig/debug/com/seatgeek/android/buildconfig/BuildConfig.java:13: error: incompatible types: String cannot be converted to String[]
public static final String[] ADDITIONAL_OAUTH_SCOPES = "new String[]{}";
^
The contract for build config fields explicitly states:
"The field is generated as: <type> <name> = <value>; This means each of these must have valid Java content. If the type is a String, then the value should include quotes"
It appears as if the gradle plugin is now inserting quotes in violation of this. 4.0.0 compiles and works as expected.