Hi is there any adjustment need to be done when us...
# k2-adopters
d
Hi is there any adjustment need to be done when using k2? i got error
Symbol public final static field EVENT_ID: R|kotlin/String| = String(event_id)
is invisible
any clue ? thank you
d
Could you please provide more details? How is this field is declared? How it is accessed?
d
This is the field from android https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/provider/CalendarContract.java
Copy code
public final class CalendarContract {
  protected interface AttendeesColumns {
    String ATTENDEE_EMAIL = "attendeeEmail";


  }
}
d
And how do you access it? From same module/from other module? How is it imported, is call-site in same package as
CalendarContract
or not?
d
Copy code
val cRingtone: Boolean = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.CUSTOM_RINGTONE))?.length ?: 0 > 0
it is imported
Copy code
import android.provider.ContactsContract
Because im using android library plugin so able to import it
i will try to create reproducable project later and report this one. Btw i got another error after ingnoring those class, now error on another module: 'com.traveloka.android.common.localization.provider.LocaleProvider' is compiled by the new Kotlin compiler frontend and cannot be loaded by the old compiler Do i need to enable k2 on all module ?
d
This issue is known and fixed in 1.8.20 https://youtrack.jetbrains.com/issue/KT-54921
Do i need to enable k2 on all module ?
Yes
d
so this mean i need to remove kapt from my project to use k2 ?
d
K2 compiler is not stable, which means that we can not guarantee that ABI of same code won't change between compilation with 1.8 and 1.9. So because of that we mark all binaries compiled with K2 as unsatable, to prevent leaking it into production code Since kapt is not supported by K2 yet you can add
-Xallow-unstable-dependencies
to modules with kapt This arg allows compiler to depend on unstable binaries But be careful and don't publish such binaries to users
Those cautions are more relevant for library authors, but I steel must to warn about them
d
ah okay thanks. is there any article to show how much improvement when using k2 ?
d
All user-visible improvements are mostly in performance of compilation In regular compilations we observe 2x-2.5x performance boost comparing with current compiler If you are interested in real compiler/language changes (which are mostly bug/architecture/design fixes) you can check YT tickets with
fixed-in-k2
tag
d
noted, thank you for info