在路径上找不到类“org.apache.log4j.Logger”:DexPathList [

时间:2015-07-24 14:19:10

标签: android log4j

我在lib文件夹中有我的jar文件。我在gradle文件中添加了所有必需的依赖项:

compile 'com.android.support:appcompat-v7:22.0.0'
provided files('libs/asmack-android-6-0.8.2.jar')
provided files('libs/bcprov-jdk15on-147.jar')
provided files('libs/jdom-2.0.4.jar')
provided files('libs/jetty-continuation-8.1.10.v20130312.jar')
provided files('libs/jetty-http-8.1.10.v20130312.jar')
provided files('libs/jetty-io-8.1.10.v20130312.jar')
provided files('libs/jetty-server-8.1.10.v20130312.jar')
provided files('libs/jetty-util-8.1.10.v20130312.jar')
provided files('libs/jetty-websocket-8.1.10.v20130312.jar')
provided files('libs/sc-light-jdk15on-1.47.0.2.jar')
provided files('libs/scpkix-jdk15on-1.47.0.2.jar')
provided files('libs/scprov-jdk15on-1.47.0.2.jar')
provided files('libs/servlet-api-3.0.jar')
provided files('libs/slf4j-api-1.7.12.jar')
provided files('libs/log4j-1.2.17.jar')
provided files('libs/slf4j-jdk14-1.7.12.jar')
provided files('libs/log4j-over-slf4j-1.7.12.jar')

private static final Logger LOG = Logger.getLogger(MainActivity.class);

我有很多ClassNoTFound

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

在build.gradle文件中,尝试以下操作:

dependencies {
    compile files('libs/slf4j-api-1.7.12.jar')
    // Other dependencies.
}

另外,尝试清理并重建项目。