简体   繁体   English

android dynamodb中的错误— NoClassDefFoundError logging.LogFactory

[英]Error in android dynamodb — NoClassDefFoundError logging.LogFactory

I am developing an app where I am using Amazon DynamoDB using DynamoDBmapper. 我正在开发一个使用DynamoDBmapper使用Amazon DynamoDB的应用程序。 I am getting the following error. 我收到以下错误。

Following is a logcat: 以下是logcat:

E/AndroidRuntime: FATAL EXCEPTION: main 
java.lang.NoClassDefFoundError: com.amazonaws.org.apache.commons.logging.LogFactory
at com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper.

Even after I did everything that is suggested here , I am not getting rid of the error. 即使在执行了此处建议的所有操作之后,我仍然没有摆脱错误。

Can someone help me? 有人能帮我吗?

I am using Android Studio. 我正在使用Android Studio。 I added the commons-logging.jar in the libs folder. 我在libs文件夹中添加了commons-logging.jar。

I am not sure what else do I mention here. 我不确定我在这里还提到什么。 If you could ask particular question, I would be able to reply. 如果您可以提出特定问题,我将可以答复。

Guys.. please help. 伙计们..请帮助。 Already wasted a week trying find solution for this without any luck yet. 已经浪费了一个星期,试图为此找到解决方案,但还没有任何运气。

AWS Android SDK: 2.2.13 AWS Android SDK:2.2.13

build.gradle: build.gradle:


apply plugin: 'com.android.application'

android {  
    compileSdkVersion 23  
    buildToolsVersion '23.0.3'  
    defaultConfig {  
        applicationId "com.example.lenovo.dynamodb6"  
        minSdkVersion 17  
        targetSdkVersion 23  
        versionCode 1  
        versionName "1.0"  
    }  
    buildTypes {  
        release {  
            minifyEnabled false  
            proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'  
        }  
    }  
    sourceSets {  
        main {  
            resources.srcDirs = ['src/main/java']  
        }  
    }  
    productFlavors {  
    }  

    repositories {  
        jcenter()  
    } }  

dependencies {  
    compile fileTree(dir: 'libs', include: ['*.jar'])  
    testCompile 'junit:junit:4.12'  
    compile files('libs/commons-logging-1.2.jar')  
    compile files('libs/commons-codec-1.6.jar')  
    compile files('libs/jackson-core-2.5.3.jar')  
    compile files('libs/httpcore-4.3.3.jar')  
    compile files('libs/httpclient-4.3.6.jar')  
    compile files('libs/jackson-annotations-2.5.0.jar')  
    compile 'com.android.support:appcompat-v7:23.1.1'  
    compile 'com.amazonaws:aws-android-sdk-core:2.2.13'  
    compile 'com.amazonaws:aws-android-sdk-ddb:2.2.13'  
    compile 'com.amazonaws:aws-android-sdk-ddb-mapper:2.1.8' } 

The problem is incorrect version of DynamoDB mapper. 问题是DynamoDB映射器的版本不正确。 Please bump com.amazonaws:aws-android-sdk-ddb-mapper to 2.2.13 or later. 请将com.amazonaws:aws-android-sdk-ddb-mapper提升至2.2.13或更高版本。 The structure of AWS Android SDK libraries has been changed from 2.1.x to 2.2.x. AWS Android SDK库的结构已从2.1.x更改为2.2.x。 Please don't not mix them. 请不要将它们混合。

PS: using Apache HttpClient 4.3 in an Android project may cause trouble, as Android has its legacy version of HttpClient. PS:在Android项目中使用Apache HttpClient 4.3可能会引起麻烦,因为Android具有其旧版HttpClient。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM