问题描述
我正在尝试添加此 https://github.com/ArthurHub/Android-Image -Cropper 但是,当我添加它时,出现此错误错误:程序类型已存在:androidx.versionedparcelable.ParcelImpl"
I'm Trying to add this https://github.com/ArthurHub/Android-Image-Cropper But when i add it i get this error "Error: Program type already present: androidx.versionedparcelable.ParcelImpl"
我附上了项目gradle和应用gradle. (我是android开发的新手,不确定要如何解决.)
I have attached project gradle and app gradle. (i'm new to android development and am not entirely sure how to fix.)
我认为这可能与
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:design:${supportLibVersion}"
但是这些在我的活动布局之一中用于TextInputLayout.任何帮助将不胜感激.
But these are used for TextInputLayout in one of my layouts for an activity.Any help will be greatly appreciated.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven{
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App Gradle:
App Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.something.app"
minSdkVersion 24
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'
}
}
}
ext {
supportLibVersion = '27.1.1' // variable that can be referenced to keep support libs consistent
}
dependencies {
api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:design:${supportLibVersion}"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.3'
testImplementation 'junit:junit:4.12'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:support-v4:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:design:28.0.0-rc01'
//implementation 'com.google.android.gms:play-services-maps:16.0.0'
// implementation 'com.google.android.gms:play-services-analytics:7.3.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.4'
implementation 'com.google.android.gms:play-services-places:16.0.0'
}
apply plugin: 'com.google.gms.google-services'
推荐答案
您使用支持库,而新版本的Image-Cropper
库使用androidx
库.
You use support library whereas new version of Image-Cropper
Library used androidx
library.
检查更改日志
因此,您有两个选择,要么可以移至androidx
,要么将库版本更改为旧版本
So, You have two option either you can move to androidx
or change library version to old version
api 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
这篇关于错误:程序类型已存在:androidx.versionedparcelable.ParcelImpl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!