【问题标题】:Type org.json.JSONException is defined multiple times类型 org.json.JSONException 被定义多次
【发布时间】:2020-11-25 04:53:19
【问题描述】:

当我在 android 中生成签名的 APK 时,这个错误一次又一次地出现,并且 jetified-jav-json 文件正在打开。这可能是由于我的 gradle 文件——这是由 android studio 生成的错误——

类型 org.json.CDL 被定义多次:C:\Users\91971.gradle\caches\transforms-2\files-2.1\4ff16b76dc52b01ac4898d797a9f3375\jetified-java-json.jar:org/json/CDL.class , C:\Users\91971\AndroidStudioProjects\APS-Money-updated\aeps_lib-1July\build.transforms\832bfa6b3f0d8c75ed631f792cb4e02d\jetified-aeps_lib-1July-runtime.jar:org/json/CDL.class

这是我的 build.gradle--

  apply plugin: 'com.android.application'
  android {
packagingOptions {
    exclude 'AndroidManifest.xml'
}

compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
    applicationId "com.aps.apsmoney"
    minSdkVersion 21
    targetSdkVersion 28
    multiDexEnabled true
    versionName "1.0"
    versionCode 1
    //versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    android {
        lintOptions {
            checkReleaseBuilds false
            abortOnError false
        }
    }
    aaptOptions { cruncherEnabled = false }

}
buildTypes {
    release {

        minifyEnabled true
        shrinkResources true
       // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        zipAlignEnabled true
        debuggable = false
        jniDebuggable = false
    }
}

}

依赖{ 实现文件树(包括:['*.jar'],目录:'libs')

implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.squareup.picasso:picasso:2.3.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:design:28.0.0'
implementation files('libs/org.apache.http.legacy.jar')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation files('libs/signpost-core-1.2.1.2.jar')
implementation('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
    exclude group: 'com.google.android', module: 'support-v4'
}
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation files('libs/java-json.jar')
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation project(':aeps_lib-1July')
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:3.3.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'androidx.multidex:multidex:2.0.1'

}

【问题讨论】:

    标签: android gradle


    【解决方案1】:

    这是由于我添加了一些未使用的依赖项...删除未使用的依赖项并解决问题....请一一删除依赖项检查哪个依赖项正在影响项目....我花了大约 1 周的时间找到这个错误...

    【讨论】:

      猜你喜欢
      • 2021-05-15
      • 1970-01-01
      • 2020-06-15
      • 2020-07-16
      • 2020-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-05
      相关资源
      最近更新 更多