java - 如何在gradle中修复“程序类型已经存在”?
问题描述
我还是个新手,还是个学生。我正在尝试在 Android Studio 中构建一个应用程序,但我不知道在 gradle 中添加或删除某些内容时哪里出错了。
我检查了许多与此错误相关的不同 StackOverflow 问题,但答案都是特定于某些库的。
从其他 StackOverflow 答案中,我收集到它与我的 gradle 文件有关。所以,这里是 app/build.gradle:
`apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.jaaay.firebaseregister"
minSdkVersion 21
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 {
pickFirst 'lib/armeabi-v7a/libassmidi.so'
pickFirst 'lib/x86/libassmidi.so'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-annotations:28.0.0'
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-database:17.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:17.0.0'
implementation files('libs/CircleImageView-master/gradle/wrapper/gradle-wrapper.jar')
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation files('libs/Android-Image-Cropper-master/gradle/gradle/wrapper/gradle-wrapper.jar')
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
}
apply plugin: 'com.google.gms.google-services'`
这是问题:
Program type already present: org.gradle.cli.CommandLineOption
Message{kind=ERROR, text=Program type already present: org.gradle.cli.CommandLineOption, sources=[Unknown source file], tool name=Optional.of(D8)}
解决方案
推荐阅读
- reactjs - 尝试将数据从地图方法返回到我的渲染并获取对象错误
- google-apps-script - 如何用包含数字的标识符替换编号列表元素
- reactjs - React Router App 在重新加载子页面时获得 404 - 无服务器,没有 webpack
- flutter - 如何在长按上选择的 GridView 项目上显示另一个容器
- python - Python OpenCV 读取大二维码有困难
- vb.net - LinQ(语言综合查询)
- java - 如何从json响应中获取特定对象
- android - Read_EXTERNAL_STORAGE 权限目标 sdk 29
- python - cv2.Canny() 是否执行高斯模糊?
- javascript - d3.js + react.js 和传递数据的问题