2016-02-17 57 views
1

我使用Comriva庫爲我的語音識別項目提取MFCC功能。我已經將comriva核心軟件包導入到我的項目中。當我累了構建它即時得到這個錯誤的gradle中,在Android Studio中創建Comriva工作室

Information:Gradle tasks [:app:assembleDebug] 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE 
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE 
:app:prepareComAndroidSupportRecyclerviewV72220Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE 
:app:prepareDebugDependencies 
:app:compileDebugAidl UP-TO-DATE 
:app:compileDebugRenderscript UP-TO-DATE 
:app:generateDebugBuildConfig UP-TO-DATE 
:app:generateDebugAssets UP-TO-DATE 
:app:mergeDebugAssets UP-TO-DATE 
:app:generateDebugResValues UP-TO-DATE 
:app:generateDebugResources UP-TO-DATE 
:app:mergeDebugResources UP-TO-DATE 
:app:processDebugManifest UP-TO-DATE 
:app:processDebugResources UP-TO-DATE 
:app:generateDebugSources UP-TO-DATE 
:app:processDebugJavaRes UP-TO-DATE 
:app:compileDebugJava UP-TO-DATE 
:app:compileDebugNdk UP-TO-DATE 
:app:compileDebugSources UP-TO-DATE 
:app:collectDebugMultiDexComponents UP-TO-DATE 
:app:packageAllDebugClassesForMultiDex UP-TO-DATE 
:app:shrinkDebugMultiDexComponents UP-TO-DATE 
:app:createDebugMainDexClassList UP-TO-DATE 
:app:dexDebug 
trouble processing "javax/xml/stream/events/StartElement.class": 
Ill-advised or mistaken usage of a core class (java.* or javax.*) 
when not building a core library. 
This is often due to inadvertently including a core library file 
in your application's project, when using an IDE (such as 
Eclipse). If you are sure you're not intentionally defining a 
core class, then this is the most likely explanation of what's 
going on. 
However, you might actually be trying to define a class in a core 
namespace, the source of which you may have taken, for example, 
from a non-Android virtual machine project. This will most 
assuredly not work. At a minimum, it jeopardizes the 
compatibility of your app with future versions of the platform. 
It is also often of questionable legality. 
If you really intend to build a core library -- which is only 
appropriate as part of creating a full virtual machine 
distribution, as opposed to compiling an application -- then use 
the "--core-library" option to suppress this error message. 
If you go ahead and use "--core-library" but are in fact 
building an application, then be forewarned that your application 
will still fail to build or run, at some point. Please be 
prepared for angry customers who find, for example, that your 
application ceases to function once they upgrade their operating 
system. You will be to blame for this problem. 
If you are legitimately using some code that happens to be in a 
core package, then the easiest safe alternative you have is to 
repackage that code. That is, move the classes in question into 
your own package namespace. This means that they will never be in 
conflict with core system classes. JarJar is a tool that may help 
you in this endeavor. If you find that you cannot do this, then 
that is an indication that the path you are on will ultimately 
lead to pain, suffering, grief, and lamentation. 
1 error; aborting 
Error:Execution failed for task ':app:dexDebug'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1 
Information:BUILD FAILED 
Information:Total time: 5.524 secs 
Information:1 error 
Information:0 warnings 
Information:See complete output in console 

我並沒有包括任何XML庫到目前爲止喜歡簡單的XML。

這是我gradle.build文件,

apply plugin: 'com.android.application' 

android { 

    compileSdkVersion 22 
    buildToolsVersion "22.0.1" 

    defaultConfig { 
     applicationId "info.androidhive.sleepApp" 
     minSdkVersion 15 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
     // Enabling multidex support. 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:22.2.0' 
    compile 'com.android.support:recyclerview-v7:22.2.0' 
    compile files('libs/jl1.0.jar') 

    compile files('libs/commons-logging-api.jar') 
    compile files('libs/cp.jar') 
      compile files('libs/http-2.2.1.jar') 
      compile files('libs/jama-1.0.2.jar') 
      compile files('libs/jl1.0.jar') 
      compile files('libs/jogg-0.0.7.jar') 
      compile files('libs/lucene-analyzers-3.0.0.jar') 
      compile files('libs/lucene-core-3.0.0.jar') 
      compile files('libs/lucene-queries-3.0.0.jar') 
      compile files('libs/lucene-queryparser-3.0.0.jar') 
      compile files('libs/lucene-snowball-3.0.3.jar') 
      compile files('libs/jorbis-0.0.15.jar') 
      compile files('libs/mdsj.jar') 
      compile files('libs/tritonus_remaining.jar') 
      compile files('libs/tritonus_share.jar') 
      compile files('libs/wstx-lgpl-3.0.1.jar') 
      compile files('libs/weka-stable-3.6.13.jar') 
      compile files('libs/stax-api-1.0.jar') 
      compile files('libs/mp3spi1.9.4.jar') 
} 

請幫我解決這個問題。

回答

1

我想出了stax-api-1.0.jar這個問題,它包含了移除jar之後的javax.xml.stream.events。*類,我能夠成功地構建它。這個罐子與comriva一起出現,這就是爲什麼我沒有注意到它。

2

您沒有明確包含的庫有時可能會被傳入到您的構建中 - 就像您添加的庫一樣,這取決於另一個庫。

您可以運行gradle dependencies來顯示依賴關係樹來分析哪些依賴關係在哪些傳遞依賴關係中拉動。