【问题标题】:After upgrade gradle : Program type already present: net.jcip.annotations.GuardedBy升级 gradle 后:程序类型已经存在:net.jcip.annotations.GuardedBy
【发布时间】:2019-03-26 13:27:21
【问题描述】:

在我升级 gradle 后,还有 gms,我遇到了一个错误

程序类型已经存在:net.jcip.annotations.GuardedBy Message{kind=ERROR, text=Program type already present: net.jcip.annotations.GuardedBy, sources=[Unknown source file], tool name=Optional.of(D8)}

  apply plugin: 'com.android.application'
 configurations {
  all*.exclude group: 'com.android.support', module: 'support-v4'
  }
  buildscript {
  repositories {
     jcenter()
    mavenCentral()
 }

 }
   def AAVersion = '4.6.0' // change this to your desired version, for 
  example the latest stable: 4.1.0


 android {
 signingConfigs {
    config {
        keyAlias 'toefl2017'
        keyPassword 'sangohan1987'

        storePassword 'sangohan1987'
    }
}
compileSdkVersion 28
buildToolsVersion "28.0.0"
defaultConfig {
    applicationId "com.ouamassi.widaf"
    minSdkVersion 14
    targetSdkVersion 28
    versionCode 5
    versionName "1.03"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
    javaCompileOptions{
        annotationProcessorOptions{
            includeCompileClasspath = true
        }

    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}


buildTypes {
    release {
        minifyEnabled false
        debuggable false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
    debug {
    }
}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/LGPL2.1'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/ASL2.0'
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation ('com.android.billingclient:billing:1.2.2')
implementation ("org.androidannotations:androidannotations:$AAVersion")
implementation ("org.androidannotations:androidannotations-api:$AAVersion")
implementation ('com.google.android.gms:play-services:12.0.0')
implementation project(path: ':fivestarslibrary', configuration: 'default')

}

这个 GuardedBy 东西在哪里?我搜索它,但我什么也没找到

通用等级

// Top-level build file where you can add configuration options common to all sub-projects/modules.

 buildscript {
  repositories {
    jcenter()
    google()
}
dependencies {

    classpath 'com.android.tools.build:gradle:3.1.1'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
    classpath 'com.google.gms:google-services:3.1.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
  repositories {
    google()
    jcenter()
}
}

task clean(type: Delete) {
   delete rootProject.buildDir
 }

任何帮助将不胜感激

【问题讨论】:

    标签: android gradle dependencies


    【解决方案1】:

    有了这个: ./gradlew 应用程序:依赖项 我得到了依赖项的详细信息,所以我检测到问题来自 androidannotations

    所以而不是:

    实现(“org.androidannotations:androidannotations:$AAVersion”) 实现(“org.androidannotations:androidannotations-api:$AAVersion”)

    我不得不说:

    annotationProcessor ("org.androidannotations:androidannotations:$AAVersion") 实现(“org.androidannotations:androidannotations-api:$AAVersion”)

    并添加:

    multiDexEnabled 真

    实现'com.android.support:multidex:1.0.3'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-26
      • 2018-09-23
      • 2019-02-22
      • 1970-01-01
      • 2018-10-21
      • 1970-01-01
      • 2018-10-03
      • 2019-04-10
      相关资源
      最近更新 更多