NoClassDefFoundError using Jackson 2.2.x on Android with Gradle

后端 未结 2 577
天命终不由人
天命终不由人 2020-12-19 02:19

For my Android project I set up Gradle with Jackson 2.2.x as follows:

// build.gradle
buildscript {
    repositories {
        mavenCentral()
    }
         


        
2条回答
  •  太阳男子
    2020-12-19 02:53

    Gradle

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 22
        buildToolsVersion "22.0.1"
    
        defaultConfig {
            applicationId "com.app.test"
            minSdkVersion 9
            targetSdkVersion 22
            versionCode 4
            versionName "1.3"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        packagingOptions {
            exclude 'META-INF/DEPENDENCIES'
            exclude 'META-INF/NOTICE'
            exclude 'META-INF/LICENSE'
        }
    }
    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')  
        compile 'com.android.support:appcompat-v7:22.2.0'  `enter code here`
        compile 'com.fasterxml.jackson.core:jackson-databind :2.5.3'
    
    }
    

    Add permission and dependency into you Gradle and then build gradle you will get Object wrapper class

提交回复
热议问题