错误:程序类型已存在:com.google.common.annotations.Beta

Error: Program type already present: com.google.common.annotations.Beta(错误:程序类型已存在:com.google.common.annotations.Beta)
本文介绍了错误:程序类型已存在:com.google.common.annotations.Beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

自从我的 android studio 几天前更新后,由于这个错误,我一直在努力让我的应用程序再次运行.

Since my android studio updated a couple of days ago, I have been struggling to get my application running again due to this error.

Program type already present: com.google.common.annotations.Beta    
Message{kind=ERROR, text=Program type already present: 
com.google.common.annotations.Beta, sources=[Unknown source file], tool name=Optional.of(D8)}

这是我的 build.gradle:

Here is my build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
defaultConfig {
    applicationId "com.dissertation.bitcoin.bitparking"
    minSdkVersion 21
    targetSdkVersion 27
    multiDexEnabled true
    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(include: ['*.jar'], dir: 'libs')
implementation('com.android.support:appcompat-v7:27.1.0')
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.http-client:google-http-client-android:1.23.0'
implementation 'com.google.api-client:google-api-client-android:1.23.0'
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.google.api-client:google-api-client-gson:1.23.0'
implementation 'com.googlecode.json-simple:json-simple:1.1'
implementation files('libs/java-json.jar')
implementation 'com.android.support:support-compat:27.1.0'
implementation 'com.github.bumptech.glide:glide:4.3.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google:bitcoinj:0.11.3'
implementation 'de.schildbach.wallet:integration-android:2.0'
}

上周这段代码对我来说运行良好.但是,由于我对 android 开发还很陌生,所以我可能忽略了一些东西.任何帮助将不胜感激,谢谢.

This code was working fine for me last week. However as I am fairly new to android development, I may have overlooked something. Any help would be appreciated, thank you.

推荐答案

只需尝试将 exclude module: 'guava-jdk5' 添加到 google api 导入中,如下所示:

Just try add exclude module: 'guava-jdk5' to google apis imports like this:

implementation('com.google.api-client:google-api-client-android:1.20.0') {
    exclude module: 'guava-jdk5'
}

这篇关于错误:程序类型已存在:com.google.common.annotations.Beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
cocos2d-android: how to display score(cocos2d-android:如何显示分数)
Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
Android file copy(安卓文件拷贝)
Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)