2016-10-17 7 views
0

app/build.gradleファイルにpoi-ooxmlを追加しようとしたときにこのエラーが発生しています "実行に失敗しました":app:transformClassesWithDexForDebug'.com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException: 'java'がゼロ以外の終了値1で終了しました "実行に失敗しました:app:transformClassesWithDexForDebug'.internal.ExecException: 'java'がゼロ以外の終了値1で処理されました

アプリ/ build.gradle:

apply plugin: 'com.android.application' 

android { 
     compileSdkVersion 23 
     buildToolsVersion "23.0.2" 

defaultConfig { 
    applicationId "applicationID" 
    minSdkVersion 15 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 

}

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 
    compile 'com.google.android.gms:play-services-ads:8.4.0' 
    compile 'com.google.android.gms:play-services-gcm:8.4.0' 
    compile 'com.google.android.gms:play-services:8.4.0' 
    compile 'com.google.android.gms:play-services-identity:8.4.0' 
    compile files('libs/jxl.jar') 
    compile group: 'org.apache.poi', name: 'poi', version: '3.9' 
    compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9' 
    } 

Logcat

Information:Gradle tasks [:app:assembleDebug] 
:app:preBuild UP-TO-DATE 
:app:preDebugBuild UP-TO-DATE 
:app:checkDebugManifest 
:app:preReleaseBuild UP-TO-DATE 
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE 
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE 
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE 
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE 
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE 
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE 
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library 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:compileDebugJavaWithJavac UP-TO-DATE 
:app:compileDebugNdk UP-TO-DATE 
:app:compileDebugSources UP-TO-DATE 
:app:transformClassesWithDexForDebug 
trouble processing "javax/xml/XMLConstants.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:transformClassesWithDexForDebug'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1** 
Information:BUILD FAILED 
Information:Total time: 59.141 secs 
Information:1 error 
Information:0 warnings 
Information:See complete output in console 
+0

アンドロイドスタジオで 'キャッシュを無効にして再起動しましたか? – Max

+0

ありがとうございます。はい、私はアンドロイドスタジオでキャッシュ無効化と再起動オプションを試しました。しかし、まだ同じエラーに直面しています。 – ASK

+0

あなたのプロジェクトを掃除して再構築しようとしてください – rookieDeveloper

答えて

2

のApache POIが原因あなたがに実行される様々な問題にAndroid上で箱から出して動作しません

defaultConfig { 

// Enabling multidex support. 

multiDexEnabled true 

} 
裸のApache POIを使用している場合。

一部のAndroid上でのApache POIの部品を使用することを可能にするプロジェクトがあります:(アンドロイド5用)

  1. https://github.com/andruhon/android5xlsxhttps://github.com/andruhon/AndroidReadXLSX(アンドロイド4用)、両方が現在まだApacheのPOI 3.12に基づいていますが、
  2. https://github.com/centic9/poi-on-android/(Android 5の場合、私が管理しています)、より簡単にPOIの新しいバージョンで再コンパイルすることができます。それは現在3.15を使用しています
+0

センシックに感謝します。解決策が働いた。 – ASK

0
私は、deafultConfigを追加しようとする前にこの問題に直面した

+0

"multiDexEnabled true"を追加しようとしました。 – ASK

+0

エラー:「エラー:タスクの実行に失敗しました:app:transformClassesWithDexForDebug」。 > com.android。 build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:プロセス 'command'/usr/lib/jvm/java-8-oracle/bin/java ''はゼロ以外の終了値1で終了しました。 – ASK

関連する問題