Java 错误:程序类型已存在:com.google.auto.value.AutoValue$Builder
如果我使用模拟器,程序工作正常,但当我尝试创建一个版本时,会出现错误…错误:程序类型已存在:com.google.auto.value.AutoValue$Builder 我唯一修改的代码是Firebase代码,但模拟器可以工作 怎样才能找到哪个模块是重复的 这是我的祖父:Java 错误:程序类型已存在:com.google.auto.value.AutoValue$Builder,java,android,Java,Android,如果我使用模拟器,程序工作正常,但当我尝试创建一个版本时,会出现错误…错误:程序类型已存在:com.google.auto.value.AutoValue$Builder 我唯一修改的代码是Firebase代码,但模拟器可以工作 怎样才能找到哪个模块是重复的 这是我的祖父: buildscript { repositories { maven { url 'https://maven.fabric.io/public' } } dependencies
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.28.1'
}
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
}
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
if (enable_plugin_kotlin) {
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
}
// Create a variable called keystorePropertiesFile, and initialize it to your
// keystore.properties file, in the rootProject folder.
def keystorePropertiesFile = rootProject.file("keystore.properties")
// Initialize a new Properties() object called keystoreProperties.
def keystoreProperties = new Properties()
// Load your keystore.properties file into the keystoreProperties object.
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
dependencies {
implementation('com.crashlytics.sdk.android:crashlytics:2.9.8') {
transitive = true
}
}
android {
packagingOptions {
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'
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
signingConfigs {
config {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
release {
keyAlias keystoreProperties['keyAlias']
storeFile file(keystoreProperties['storeFile'])
keyPassword keystoreProperties['keyPassword']
storePassword keystoreProperties['storePassword']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion version_setup_compileSdk
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
applicationId "com.bandweb.myrecipesmaker"
minSdkVersion version_setup_minSdk
//targetSdkVersion 27
//versionCode 1
//versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
def versionPropsFile = file('version.properties')
if (versionPropsFile.canRead()) {
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
def value = 0
def runTasks = gradle.startParameter.taskNames
if ('assemble' in runTasks || 'assembleRelease' in runTasks || 'aR' in runTasks) {
value = 1
}
def versionMajor = versionProps['VERSION_MAJOR'].toInteger()
def versionMinor = versionProps['VERSION_MINOR'].toInteger()
def versionPatch = versionProps['VERSION_PATCH'].toInteger() + value
def versionBuild = versionProps['VERSION_BUILD'].toInteger() + 1
def versionNumber = versionProps['VERSION_NUMBER'].toInteger() + value
versionProps['VERSION_PATCH'] = versionPatch.toString()
versionProps['VERSION_BUILD'] = versionBuild.toString()
versionProps['VERSION_NUMBER'] = versionNumber.toString()
versionProps.store(versionPropsFile.newWriter(), null)
println "VERSION_CODE incremented to " + value
defaultConfig {
applicationId "com.bandweb.myrecipesmaker"
versionCode versionNumber
versionName "${versionMajor}.${versionMinor}.${versionPatch} (${versionBuild}) Release"
vectorDrawables.useSupportLibrary = true
signingConfig signingConfigs.config
multiDexEnabled true //important
buildConfigField "boolean", "IS_TEST_BUILD", "false"
buildConfigField "String[]", "APPLICATION_LANGUAGES", "${getUsedAndroidLanguages()}"
}
// If you use each() to iterate through the variant objects,
// you need to start using all(). That's because each() iterates
// through only the objects that already exist during configuration time—
// but those object don't exist at configuration time with the new model.
// However, all() adapts to the new model by picking up object as they are
// added during execution.
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${variant.name}-${variant.versionName}.apk"
}
}
} else {
throw new GradleException("Could not read version.properties!")
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "CRASHLYTICS_ENABLED", 'true'
}
debug {
buildConfigField "boolean", "CRASHLYTICS_ENABLED", 'false'
}
}
}
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
all*.exclude group: 'com.android.support', module: 'support-v4'
}
//configurations.all { exclude group: 'com.android.support', module: 'support-v4' }
dependencies {
//def nav_version = "1.0.0-alpha11"
def nav_version = "1.0.0"
implementation "android.arch.navigation:navigation-fragment:$nav_version" // use -ktx for Kotlin
implementation "android.arch.navigation:navigation-ui:$nav_version" // use -ktx for Kotlin
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:${version_library_appcompat}"
implementation "com.android.support:support-v4:${version_library_appcompat}"
implementation "com.android.support:design:${version_library_appcompat}"
implementation "com.android.support:cardview-v7:${version_library_appcompat}"
implementation "com.android.support:gridlayout-v7:${version_library_appcompat}"
//implementation 'com.android.support:support-annotations:28.0.0'
// Dependency for Google Sign-In
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation files('libs/super-csv-2.4.0.jar')
// Check for v11.4.2 or higher
// implementation 'com.google.firebase:firebase-crash:16.2.1'
// implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-iid:17.1.2'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.6'
implementation 'com.google.firebase:firebase-auth:16.2.1'
// implementation 'com.google.firebase:firebase-admin:6.7.0'
implementation "android.arch.work:work-runtime:1.0.0"
implementation 'com.opencsv:opencsv:3.7'
implementation 'commons-io:commons-io:2.5'
implementation 'org.apache.commons:commons-lang3:3.4'
// implementation files('libs/commons-csv-1.6.jar')
// Joda-time
implementation 'net.danlew:android.joda:2.9.9'
// Add dependency
//implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
// Dependencies for the REST API example
implementation 'com.google.api-client:google-api-client:1.25.0'
implementation 'com.google.api-client:google-api-client-android:1.22.0'
implementation 'com.google.apis:google-api-services-people:v1-rev139-1.22.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'me.tankery.lib:permission-requester:1.0.0'
implementation 'com.takisoft.fix:preference-v7:28.0.0.0'
implementation 'com.takisoft.fix:preference-v7-simplemenu:28.0.0.0'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
//implementation 'com.afollestad.material-dialogs:core:2.0.0-rc7'
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
// Tool libraries
implementation "com.jakewharton:butterknife:${version_library_butterknife}"
implementation 'commons-io:commons-io:2.5'
if (enable_plugin_kotlin) {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$version_plugin_kotlin"
}
implementation('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.11.0@aar') {
transitive = true
}
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.github.vipulasri:timelineview:1.1.0'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
implementation 'uk.co.samuelwall:material-tap-target-prompt:2.13.0'
// fragment util
//implementation 'com.blankj:utilcode:1.22.10'
// Glide image library
implementation 'com.github.bumptech.glide:glide:4.8.0'
// implementation ('com.github.worker8:tourguide:2.0.0-SNAPSHOT@aar') {
// transitive=true
// }
// implementation 'com.github.wangjiegulu:rfab:2.0.0'
//implementation 'com.rm:rmswitch:1.2.2'
annotationProcessor "com.jakewharton:butterknife-compiler:${version_library_butterknife}"
//AutoValue
compileOnly "com.google.auto.value:auto-value:$autoValueVersion"
annotationProcessor "com.google.auto.value:auto-value:$autoValueVersion"
//annotationProcessor 'frankiesardo:auto-parcel:1.0.3'
//compileOnly 'com.jakewharton.auto.value:auto-value-annotations:1.5'
// annotationProcessor 'com.google.auto.value:auto-value:1.5.2'
//implementation 'com.github.Zhuinden:simple-stack:1.13.1'
implementation 'com.sun.mail:android-mail:1.6.0'
implementation 'com.sun.mail:android-activation:1.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// Processors
def anpros = ["com.jakewharton:butterknife-compiler:${version_library_butterknife}"]
//implementation 'com.google.android.material:material:1.0.0'
//implementation 'androidx.recyclerview:recyclerview:1.0.0'
for (anpro in anpros) {
if (enable_plugin_kotlin) {
kapt anpro
} else {
annotationProcessor anpro
}
}
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
}