質問です。
AndroidStudio ビルドエラーで実行出来きなくて本当に困っています。
1ヶ月程前は実行出来ていた環境でした。
環境
OSX 10.10.4
AndroidStudio 1.2.2
jdk1.7.0_79.jdk
ソースと参考にしたURLを下に載せました。
buildscript {
ext.kotlin_version = '0.12.412'
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
apply plugin: "com.android.application"
apply plugin: 'kotlin-android'
repositories {
jcenter()
mavenCentral()
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "jp.trustridge.macaroni.app"
minSdkVersion 16
targetSdkVersion 22
versionCode 10
versionName "1.6"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile 'com.android.support:support-v13:+'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:+'
compile "org.jetbrains.kotlin:kotlin-stdlib:+"
compile 'com.parse.bolts:bolts-android:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
// volley
compile 'com.mcxiaoke.volley:library:+'
// realm
compile 'io.realm:realm-android:+'
// adjust
//compile 'com.adjust.sdk:adjust-android:+'
}
エラー文
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 2
参考URL http://markfour.blogspot.jp/2015/03/androidsdkerrorexecution-failed-for.html
参考にしたスタックオーバーフローの質問
『AndroidStudio(gradle)でビルドエラー Process finished with non-zero exit value 2』
試した事
compile fileTree(dir: 'libs', include: ['*.jar'])
をコメントアウト→エラー(Warning:(5, 31) 'ActionBarActivity' is deprecated. Deprecated in Java
など)
//以下をコメントアウトでエラー
compile 'com.android.support:support-v13:+'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.google.android.gms:play-services:+'
compile "org.jetbrains.kotlin:kotlin-stdlib:+"
compile 'com.parse.bolts:bolts-android:+'
// volley
compile 'com.mcxiaoke.volley:library:+'
// realm
compile 'io.realm:realm-android:+'
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
Error:(10, 21) No resource found that matches the given name: attr 'colorAccent'.
Error:(4, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(7, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command
'/Users/makki/Library/Android/sdk/build-tools/22.0.1/aapt''
finished with non-zero exit value 1
追記8/10
・参考にしたサイトその3
http://markfour.blogspot.jp/2015/03/androidsdkerrorexecution-failed-for.html
重複エラーの修正の仕方が書いてありますが、自分場合どのようにすれば良いかわかりません。
追記8/10 (2)
参照先のコマンドラインで直接gradleを実行方法がわかりません。
参考サイトを教えていただけると助かります。こちらで質問しています。
追記8/11
ターミナルからの実行結果
※helpタスクのログ削除
ーーーーーーーーーーーーー
追記 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$
$gradlew tasks
で実行可能なタスクの一覧を確認してみてください。プロジェクトのビルドをしたいのならおそらくは$gradlew build
になるのではないかと思います。