Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 721 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Unresolved reference: Parcelize" after updating to Kotlin 1.3.30

#1
I was using Kotlin 1.3.21 for a long time together with ```kotlin-android-extensions``` plugin in experimental mode for a long time. Today I swtiched to Kotlin 1.3.30 just by bumping the version and now wherever I used ```@Parcelize``` annotation I see the error:
```Unresolved reference: Parcelize```.

Here's how I enable android extensions:

apply plugin: 'kotlin-android-extensions'

androidExtensions {
experimental = true
features = ["parcelize"]
}

Notice, that I tried without explicitly declaring required features and it didn't work as well.

Also notice that I use Grrovy Gradle DSL.

How can I enable `Parcelize`back with Kotlin 1.3.30?


**EDIT** Here's my app level `build.gradle`

apply plugin: 'com.android.application'
apply plugin: "de.mannodermaus.android-junit5"
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

apply from: "../versions.gradle"

android {

compileSdkVersion 28

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.myapp.dtt"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"

vectorDrawables.useSupportLibrary = true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
androidTest.java.srcDirs += 'src/androidTest/kotlin'
}

testOptions {
junitPlatform {
filters {
engines {
include 'spek2'
}
}
}
}
}

detekt {
input = files("src/main/kotlin")
baseline = file("detekt-baseline.xml")
}

androidExtensions {
experimental = true
features = ["parcelize"]
}

dependencies {
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.google.android.material:material:$material_version"
implementation "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.recyclerview:recyclerview:$recyclerview_version"
implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
implementation "com.google.dagger:dagger:$dagger_version"
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
implementation "io.reactivex.rxjava2:rxjava:$rx_java_version"
implementation "io.reactivex.rxjava2:rxandroid:$rx_android_version"
implementation "io.reactivex.rxjava2:rxkotlin:$rx_kotlin_version"
implementation "com.github.bumptech.glide:glide:$glide_version"

debugImplementation "com.squareup.leakcanary:leakcanary-android:$leak_canary_version"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leak_canary_version"

testImplementation "org.spekframework.spek2:spek-dsl-jvm:$spek_version"
testImplementation "org.spekframework.spek2:spek-runner-junit5:$spek_version"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version"
testImplementation "io.mockk:mockk:$mockk_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version"
}

Reply

#2
I find the error

`Kotlin plugin should be enabled before 'kotlin-android-extensions'`

so change the order to

```
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
```
it work fine _(:з」∠)_ 。

good luck to you.
Reply

#3
I upgraded Kotlin plugin to latest version (1.3.61) and this error was removed.
Reply

#4
Latest kotlin version requires this plugin to use `@Parcelize`:
-------------------------------------------------------------

id 'kotlin-parcelize'

or

apply plugin: 'kotlin-parcelize'
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through