Skip to main content
replaced http://ja.stackoverflow.com/ with https://ja.stackoverflow.com/
ソース リンク

参考URL http://markfour.blogspot.jp/2015/03/androidsdkerrorexecution-failed-for.html
参考にしたスタックオーバーフローの質問
AndroidStudio(gradle)でビルドエラー Process finished with non-zero exit value 2

参照先のコマンドラインで直接gradleを実行方法がわかりません。
参考サイトを教えていただけると助かります。こちらで質問しています。

参考URL http://markfour.blogspot.jp/2015/03/androidsdkerrorexecution-failed-for.html
参考にしたスタックオーバーフローの質問
AndroidStudio(gradle)でビルドエラー Process finished with non-zero exit value 2

参照先のコマンドラインで直接gradleを実行方法がわかりません。
参考サイトを教えていただけると助かります。こちらで質問しています。

ツイート済み twitter.com/#!/jaStackOverflow/status/642816318698336256
helpタスクのログ削除
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22

BUILD SUCCESSFULと表示されている※helpタスクはビルドが成功したからでしょうか? AndroidStudioからはエラーです。ログ削除
ーーーーーーーーーーーーー

makki-no-MacBook-Pro:gnoccho makki$ ./gradlew -i
Starting Build
Settings evaluated using settings file '/Users/makki/gnoccho/settings.gradle'.
Projects loaded. Root project using build file '/Users/makki/gnoccho/build.gradle'.
Included projects: [root project 'gnoccho', project ':app']
Evaluating root project 'gnoccho' using build file '/Users/makki/gnoccho/build.gradle'.
Evaluating project ':app' using build file '/Users/makki/gnoccho/app/build.gradle'.
Creating configuration compile.
Creating configuration apk.
Creating configuration provided.
Creating configuration wearApp.
Creating configuration androidTestCompile.
Creating configuration androidTestApk.
Creating configuration androidTestProvided.
Creating configuration androidTestWearApp.
Creating configuration testCompile.
Creating configuration testApk.
Creating configuration testProvided.
Creating configuration testWearApp.
Creating configuration debugCompile.
Creating configuration debugApk.
Creating configuration debugProvided.
Creating configuration debugWearApp.
Creating configuration testDebugCompile.
Creating configuration testDebugApk.
Creating configuration testDebugProvided.
Creating configuration testDebugWearApp.
Creating configuration releaseCompile.
Creating configuration releaseApk.
Creating configuration releaseProvided.
Creating configuration releaseWearApp.
Creating configuration testReleaseCompile.
Creating configuration testReleaseApk.
Creating configuration testReleaseProvided.
Creating configuration testReleaseWearApp.
All projects evaluated.
No tasks specified. Using default task 'help'
Selected primary task 'help' from project :
Tasks to be executed: [task ':help']
:help (Thread[main,5,main]) started.
:help
Executing task ':help' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.

Welcome to Gradle 2.2.1.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see a list of command-line options, run gradlew --help
:help (Thread[main,5,main]) completed. Took 0.087 secs.

BUILD SUCCESSFUL

Total time: 10.883 secs
Stopped 0 compiler daemon(s).
makki-no-MacBook-Pro:gnoccho makki$ 

BUILD SUCCESSFULと表示されているはビルドが成功したからでしょうか? AndroidStudioからはエラーです。

makki-no-MacBook-Pro:gnoccho makki$ ./gradlew -i
Starting Build
Settings evaluated using settings file '/Users/makki/gnoccho/settings.gradle'.
Projects loaded. Root project using build file '/Users/makki/gnoccho/build.gradle'.
Included projects: [root project 'gnoccho', project ':app']
Evaluating root project 'gnoccho' using build file '/Users/makki/gnoccho/build.gradle'.
Evaluating project ':app' using build file '/Users/makki/gnoccho/app/build.gradle'.
Creating configuration compile.
Creating configuration apk.
Creating configuration provided.
Creating configuration wearApp.
Creating configuration androidTestCompile.
Creating configuration androidTestApk.
Creating configuration androidTestProvided.
Creating configuration androidTestWearApp.
Creating configuration testCompile.
Creating configuration testApk.
Creating configuration testProvided.
Creating configuration testWearApp.
Creating configuration debugCompile.
Creating configuration debugApk.
Creating configuration debugProvided.
Creating configuration debugWearApp.
Creating configuration testDebugCompile.
Creating configuration testDebugApk.
Creating configuration testDebugProvided.
Creating configuration testDebugWearApp.
Creating configuration releaseCompile.
Creating configuration releaseApk.
Creating configuration releaseProvided.
Creating configuration releaseWearApp.
Creating configuration testReleaseCompile.
Creating configuration testReleaseApk.
Creating configuration testReleaseProvided.
Creating configuration testReleaseWearApp.
All projects evaluated.
No tasks specified. Using default task 'help'
Selected primary task 'help' from project :
Tasks to be executed: [task ':help']
:help (Thread[main,5,main]) started.
:help
Executing task ':help' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.

Welcome to Gradle 2.2.1.

To run a build, run gradlew <task> ...

To see a list of available tasks, run gradlew tasks

To see a list of command-line options, run gradlew --help
:help (Thread[main,5,main]) completed. Took 0.087 secs.

BUILD SUCCESSFUL

Total time: 10.883 secs
Stopped 0 compiler daemon(s).
makki-no-MacBook-Pro:gnoccho makki$ 

※helpタスクログ削除
ーーーーーーーーーーーーー

gradlew build実行
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22

追記 8/11(2)
gradlew buildを実行してみました。

makki-no-MacBook-Pro:gnoccho makki$ ./gradlew build
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library 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:compileDebugKotlin UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
    at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
    at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
    at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)

:app:dexDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
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 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 21.375 secs
makki-no-MacBook-Pro:gnoccho makki$ 

追記 8/11(2)
gradlew buildを実行してみました。

makki-no-MacBook-Pro:gnoccho makki$ ./gradlew build
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library 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:compileDebugKotlin UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
    at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)
    at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
    at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)

:app:dexDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
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 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 21.375 secs
makki-no-MacBook-Pro:gnoccho makki$ 
gradleをターミナルから実行 ログ出し
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22
読み込んでいます
本文に 2252 文字追加
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22
読み込んでいます
本文に 184 文字追加; タグを編集
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22
読み込んでいます
本文に 273 文字追加
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22
読み込んでいます
本文に 149 文字追加
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22
読み込んでいます
書式の改善によるSyntax Highlightによる視認性の向上
ソース リンク
読み込んでいます
ソース リンク
hai123
  • 379
  • 4
  • 9
  • 22
読み込んでいます