【问题标题】:Android gradle :app:packageDebug FAILED: class org.bouncycastle.asn1.ASN1Primitive overrides final method equalsAndroid gradle:app:packageDebug FAILED: class org.bouncycastle.asn1.ASN1Primitive 覆盖 final 方法等于
【发布时间】:2015-11-17 09:33:49
【问题描述】:

我是 Android 新手,无法运行我的第一个应用。每当我尝试时,它都会抛出此错误:

Android gradle :app:packageDebug FAILED: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.

我用谷歌搜索了它,我在那里发现了很多问题。正如许多人所说,这个问题可能是由于我在项目中对 BouncyCastle 有多个依赖项。我尝试在我的项目和本地文件夹中删除 .gradle 文件夹,以便我可以从存储库中再次下载 jar,但没有任何改变。我还仔细检查了我的 JAVA_HOME 是否已设置并且它指向 1.7 版本。我试图 gradle :app:clean 和 gradle :app:dependencies 看看我是否遗漏了一些东西,但仍然......我看不到 BouncyCastle 的任何依赖......有人可以帮助我吗?

另外,这个问题发生在我没有更改任何代码的情况下...该应用程序昨天成功运行,现在给我这个错误...我不明白。谢谢。

编辑

gradle.build

顶级:

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

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.1.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
}
}

模块应用:

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.aurasphere.provaactionbar"
    minSdkVersion 11
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
compile project(':volley')
compile files('libs/gson-2.2.2.jar')
}

模块截击:

buildscript {
repositories {
    mavenCentral()
}
dependencies {
    classpath 'com.android.tools.build:gradle:0.14.+'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 19
buildToolsVersion = '21.1.0'
}

apply from: 'rules.gradle'

模块排球的rules.gradle:

apply plugin: 'com.android.library'

【问题讨论】:

  • 您需要将 Gradle 配置文件放在这里。您是否有可能包含任何内容的快照版本?
  • @chrylis 我不认为我包含任何快照...您是指 build.gradle 文件吗?
  • 是的,无论是顶级模块还是您可能拥有的任何模块。
  • @chrylis 我已经添加了 gradle 文件。谢谢。

标签: java android gradle android-gradle-plugin bouncycastle


【解决方案1】:

我自己解决了这个问题,只是将我使用的 JDK 从 x32 更改为 x64,现在可以正确编译。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 2013-02-08
    • 1970-01-01
    相关资源
    最近更新 更多