lottie android min sdk,android - 错误:“程序类型已存在:androidx.versionedparcelable.CustomVersionedParcelable”...

我遇到以下错误-> 错误:程序类型已存在:androidx.versionedparcelable.CustomVersionedParcelable

当我单击“生成错误”时,它显示以下内容:

AGPBI: {"kind":"error","text":"Program type already present: androidx.versionedparcelable.CustomVersionedParcelable","sources":[{}],"tool":"D8"}

:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED

FAILURE: Build failed with an exception.

我不明白是什么原因导致了此问题,因为我正在使用Parcelable库,但从未引起过这种类型的错误。

这是我项目的gradle文件。

apply plugin: 'com.android.application'

android {

compileSdkVersion 28

defaultConfig {

applicationId "com.example.package.name"

minSdkVersion 22

targetSdkVersion 28

versionCode 1

versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {

release {

minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

}

}

}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:appcompat-v7:28.0.0'

implementation 'com.android.support.constraint:constraint-layout:1.1.3'

testImplementation 'junit:junit:4.12'

androidTestImplementation 'com.android.support.test:runner:1.0.2'

androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

// Lottie

implementation 'com.airbnb.android:lottie:2.8.0'

//Gson

implementation 'com.google.code.gson:gson:2.8.5'

implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

//Dagger 2

implementation 'com.google.dagger:dagger:2.18'

implementation "com.google.dagger:dagger-android-support:2.18"

annotationProcessor 'com.google.dagger:dagger-compiler:2.18'

//Asyncjob

implementation 'com.arasthel:asyncjob-library:1.0.3'

//Butterknife

implementation 'com.jakewharton:butterknife:9.0.0-rc1'

annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'

}

这是我在Android Studio中的“构建”面板

8c8c1266d51ef778ca45e96a2d4cad0b.png 有什么想法吗?? 谢谢!!

更新(12-1-2018)

我想我已经找到了解决这个问题的方法。 我读到所有支持库都将迁移到androidx库。

因此,我已经阅读了Android开发者文档,并说明了如何迁移所有android.support. 库到androidx。

您只需要转到Android Studio, 然后从菜单栏中进行“ 重构>>迁移到AndroidX ”即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值