gpt4 book ai didi

android - Unresolved reference : Parcelize after adding necessary tools in gradle and updating to kotlin latest version

转载 作者:行者123 更新时间:2023-12-02 12:41:04 25 4
gpt4 key购买 nike

我正在尝试使用 @parcelize 注释数据类并收到以下错误 -

enter image description here

这是我的 gradle 文件-

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'

android {

signingConfigs {
config {
keyAlias 'verte_internal_keystore'
keyPassword ANDROID_STORE_PASSWORD
storeFile file('verte_internal_keystore.jks')
storePassword ANDROID_KEY_PASSWORD
}
}

lintOptions {
abortOnError false
}

compileSdkVersion 29
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.twoverte"
minSdkVersion 21
targetSdkVersion 29
versionCode 16
versionName ".3.4.0"
multiDexEnabled true
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
}

File signFile = project.file('keyInfos.properties')
if (signFile.exists()) {
Properties properties = new Properties()
properties.load(new FileInputStream(signFile))
signingConfigs {
release {
storeFile file(project.file(properties['keystore.filename']))
storePassword properties['keystore.password']
keyAlias properties['keystore.alias']
keyPassword properties['keystore.password']
}
}
}

buildTypes {

....

}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

productFlavors {

}

dexOptions {
javaMaxHeapSize "4g"
}
}

dependencies {
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.0.0'
configurations {
all {
exclude group: 'org.json', module: 'json'
exclude group: 'xpp3', module: 'xpp3'
}
}

//Room components
implementation 'androidx.room:room-runtime:2.2.3'
annotationProcessor 'androidx.room:room-compiler:2.2.3'

//Lifecycle components
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.1.0'

fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.cocosw:bottomsheet:1.0@aar'
implementation 'org.igniterealtime.smack:smack-android:4.1.4'
implementation 'org.igniterealtime.smack:smack-tcp:4.1.4'
implementation 'org.igniterealtime.smack:smack-im:4.1.4'
implementation 'org.igniterealtime.smack:smack-extensions:4.1.4'
implementation 'org.igniterealtime.smack:smack-sasl-provided:4.1.4'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.amazonaws:aws-android-sdk-s3:2.6.30'
implementation 'com.squareup.okhttp:okhttp:2.6.0'
implementation 'io.michaelrocks:libphonenumber-android:8.9.14'

// Preferred for scheduling background jobs when new push notifications are received.
// It provides a JobScheduler-compatible API that works on all recent versions of
// Android (API level 14+) that have Google Play services installed.
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'

implementation 'com.facebook.stetho:stetho:1.3.1'
implementation 'com.facebook.stetho:stetho-okhttp3:1.3.1'
implementation 'com.github.ksoichiro:android-observablescrollview:1.5.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.google.android.gms:play-services-identity:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'de.greenrobot:greendao:2.1.0'
implementation 'io.github.rockerhieu:emojicon:1.4.2'
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
implementation 'com.github.nkzawa:socket.io-client:0.4.2'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.github.chrisbanes.photoview:library:1.2.4'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.github.nkzawa:socket.io-client:0.4.2'
implementation 'net.opacapp:multiline-collapsingtoolbar:27.1.1'
implementation 'org.webrtc:google-webrtc:1.0.23295'
implementation 'com.github.clans:fab:1.6.4'
implementation 'io.branch.sdk.android:library:3.0.0'
implementation 'org.jsoup:jsoup:1.10.3'


implementation 'com.squareup.retrofit2:retrofit:2.7.0'
implementation 'com.squareup.retrofit2:converter-gson:2.7.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'me.relex:circleindicator:2.1.4'
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
implementation 'com.github.ganfra:material-spinner:2.0.0'


implementation(name: 'appbase', ext: 'aar')
implementation(name: 'greendao', ext: 'aar')
implementation(name: 'chat', ext: 'aar')
implementation(name: 'ffmpeg', ext: 'aar')
implementation(name: 'imagecropper', ext: 'aar')
implementation(name: 'imagepicker', ext: 'aar')
implementation(name: 'webrtc', ext: 'aar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
repositories {
mavenCentral()
}


我错过了什么?我似乎无法让编译器知道 @Parcelize 注释

我尝试更新 kotlin 版本,检查了有关此问题的多个先前问题,但没有找到任何相关的信息来帮助我。

最佳答案

更改您的 build.gradle添加kotlin-android-extensions按以下顺序。

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

除此之外,您还启用了 experimental feature使用它
androidExtensions {
experimental = true
}

关于android - Unresolved reference : Parcelize after adding necessary tools in gradle and updating to kotlin latest version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60246675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com