android - android 支持中已经存在的程序类型
问题描述
当我尝试运行应用程序时,会发生此错误:
错误:程序类型已存在:android.support.v4.os.ResultReceiver
我认为这是一个依赖问题,但我不知道如何解决。
应用级分级:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.faisal.mychat"
minSdkVersion 15
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'
}
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-v4:26.+'
implementation 'de.hdodenhof:circleimageview:2.2.0'
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'
}
apply plugin: 'com.google.gms.google-services'
项目级等级:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean
(type: Delete) {
delete rootProject.buildDir
}
解决方案
一开始加
implementation 'com.google.firebase:firebase-core:12.0.1'
不要使用+
. 请尝试对所有人使用相同且特定版本的依赖项。
例如,而不是
implementation 'com.android.support:support-v4:26.+'
利用
implementation 'com.android.support:support-v4:27.1.1'
推荐阅读
- javascript - 无法将 'touched' 设置为 true
- android - 调用视图的 offsetTopAndBottom 和 setTranslateY 的结果有什么区别?
- r - R:如何正确访问 gmailr 中的消息日期以对一组消息进行排序?
- django - 实现 djangorestframework-simplejwt 无密码令牌认证
- c++ - 为什么“函数尝试”在 C++ 中不起作用?
- python - Django - 保存图像的多个版本
- java - 我在这个多部分请求中做错了什么?
- firebase - 为什么我无法获得经过身份验证的用户 ID?
- c++ - 最大索引差异问题的数组分段错误
- python - AttributeError:模块'api.db'在Flask上没有属性'Model'