I am working on an Android application in which i am trying to get Cometd(Push technology) working. For that I added some Gradle dependencies, but I am getting a DEX error. How can I resolve this?
Error log :
Total time: 2.742 secs
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug]
Configuration on demand is an incubating feature.
: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:prepareComAndroidSupportRecyclerviewV72211Library 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:prepareComTonicartosSuperslim0413Library 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:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug
:app:dexDebug
AGPBI: {"kind":"simple","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","sources":[{}]}
AGPBI: {"kind":"simple","text":"com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:502)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:189)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.run(Main.java:246)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.dexer.Main.main(Main.java:215)","sources":[{}]}
AGPBI: {"kind":"simple","text":"\tat com.android.dx.command.Main.main(Main.java:106)","sources":[{}]}
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 '/usr/lib/jvm/java-8-oracle/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: 1 mins 5.571 secs
app.build :
apply plugin: 'com.android.application'
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.6.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.6.0'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'org.springframework.android:spring-android-core:1.0.1.RELEASE'
compile('org.springframework.android:spring-android-auth:1.0.1.RELEASE') {
exclude group: 'org.springframework', module: 'commons-logging'
exclude group: 'org.springframework', module: 'spring-core'
exclude group: 'org.springframework', module: 'spring-web'
}
compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.tonicartos:superslim:0.4.13'
compile 'commons-codec:commons-codec:1.9'
compile 'com.squareup.picasso:picasso:2.5.2'
// I added the below ones and then it started giving error
compile 'org.cometd.java:bayeux-api:3.0.4'
compile 'org.cometd.java:cometd-java-server:3.0.4'
compile 'org.cometd.java:cometd-java-client:3.0.4'
compile 'org.cometd.java:cometd-java-annotations:3.0.4'
}
android {
compileSdkVersion 'Google Inc.:Google APIs:22'
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.notes"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
// multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
/*dexOptions {
javaMaxHeapSize "4g"
}*/
}
Kindly let me know what I should do. Thanks a lot. :-)
defaultConfig {
minSdkVersion 14 //lower than 14 doesn't support multidex
targetSdkVersion 22
// Enabling multidex support.
multiDexEnabled true
}
Related
Hi everyone who reads this, well i was trying to doing a method that it said that i needed this in my gradle.build: compile 'org.apache.ant:ant:1.8.0' Then I tried to build my gradle and it doesn't worked. Well, so I removed that from my gradle and it keeps me saying that I have this error at compiling my gradle:
Executing tasks: [:app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:prepareComAndroidSupportConstraintConstraintLayout100Alpha9Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2421Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72400Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportPaletteV72400Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidVolleyVolley100Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAwareness961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesInstantapps961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCore961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage961Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon961Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: C:\Users\Rafa\AndroidStudioProjects\XabiaGame\app\google-services.json
:app:generateDebugResources
:app:mergeDebugResources
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I tried to put all my services up to date, I mean, 10.0.1 and it keeps me saying the same thing...
Check out my gradle project:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.informatica.xabiagame"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
/*repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
}*/
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
compile 'com.android.support:design:24.2.1'
compile 'com.google.android.gms:play-services-maps:9.6.1'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services:9.6.1'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-auth:9.6.1'
compile 'com.google.code.gson:gson:2.2.2'
compile 'com.android.volley:volley:1.0.0'
//compile 'org.apache.ant:ant:1.8.0'
}
apply plugin: 'com.google.gms.google-services'
________________________________-
Added my project gradle project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What's the problem? It keeps me saying the same thing everytime... Thank You.
I add a Screenshot:
Error
Try code on your module build.gradle:
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.informatica.xabiagame"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
jackOptions {
enabled true
}
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}
You've commented out the repositories block, so Gradle doesn't know where to find the library. Ensure you have a repositories block like so:
repositories {
jcenter()
}
I am having getting compilation issues after adding Realm to my project. I am currently using Kotlin within Android Studio 2.1.3. This is the output from the terminal:
C:\Users\carre\Desktop\MBTA_99\MyApplication>gradlew build
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preInstantrunconfigDebugBuild UP-TO-DATE
:app:checkInstantrunconfigDebugManifest
:app:preInstantrunconfigReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComGetkeepsafeRelinkerRelinker121Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon940Library UP-TO-DATE
:app:prepareComGoogleMapsAndroidAndroidMapsUtils044Library UP-TO-DATE
:app:prepareIoRealmRealmAndroidLibrary120Library UP-TO-DATE
:app:prepareInstantrunconfigDebugDependencies
:app:compileInstantrunconfigDebugAidl UP-TO-DATE
:app:compileInstantrunconfigDebugRenderscript UP-TO-DATE
:app:generateInstantrunconfigDebugBuildConfig UP-TO-DATE
:app:mergeInstantrunconfigDebugShaders UP-TO-DATE
:app:compileInstantrunconfigDebugShaders UP-TO-DATE
:app:generateInstantrunconfigDebugAssets UP-TO-DATE
:app:mergeInstantrunconfigDebugAssets UP-TO-DATE
:app:generateInstantrunconfigDebugResValues UP-TO-DATE
:app:generateInstantrunconfigDebugResources UP-TO-DATE
:app:mergeInstantrunconfigDebugResources UP-TO-DATE
:app:processInstantrunconfigDebugManifest UP-TO-DATE
:app:processInstantrunconfigDebugResources UP-TO-DATE
:app:generateInstantrunconfigDebugSources UP-TO-DATE
:app:incrementalInstantrunconfigDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileInstantrunconfigDebugKotlin
e: C:\Users\carre\Desktop\MBTA_99\MyApplication\app\src\main\java\ninja\carre\mbta\activities\trainstation_list\TrainListAct.kt: (21, 12): Unresolved reference: squareup
:app:compileInstantrunconfigDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileInstantrunconfigDebugKotlin'.
> Compilation error. See log for more details
* 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: 17.161 secs
Here's what my gradle files look like:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.0.3'
ext.build_tools_version = '23.2.1'
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.github.jacobono:gradle-jaxb-plugin:1.3.6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects { project ->
if(project.name.endsWith("-schema")) {
apply plugin: 'com.github.jacobono.jaxb'
dependencies {
jaxb 'com.sun.xml.bind:jaxb-xjc:2.2.7-b41'
jaxb 'com.sun.xml.bind:jaxb-impl:2.2.7-b41'
jaxb 'javax.xml.bind:jaxb-api:2.2.7'
}
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'android-apt'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
// dexOptions {
// maxProcessCount 4
// javaMaxHeapSize "2g"
// }
defaultConfig {
applicationId "ninja.carre.mbta"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
productFlavors {
instantrunconfig {
applicationId "ninja.carre.mbta"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
}
}
buildTypes {
release {
minifyEnabled true
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile(
[group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.0'],
[group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.0'],
[group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.0']
)
// Required -- JUnit 4 framework
testCompile 'junit:junit:4.12'
compile group: 'com.google.transit', name: 'gtfs-realtime-bindings', version: '0.0.4'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "com.android.support:support-annotations:$build_tools_version"
compile "com.android.support:appcompat-v7:$build_tools_version"
compile "com.android.support:support-v4:$build_tools_version"
compile "com.android.support:support-v13:$build_tools_version"
compile "com.android.support:cardview-v7:$build_tools_version"
compile "com.android.support:recyclerview-v7:$build_tools_version"
compile 'javax.annotation:javax.annotation-api:1.2-b01'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.maps.android:android-maps-utils:0.4+'
}
I started encountering this issue after adding Realm and Jackson Json parsing libraries to my project. Do you know if there's any incompatibilities between these two libraries?
EDIT 1 --- Did as you suggested and updated the build tools to the latest version and added the package classes but I am still getting an 'InstantRun' Config error. So I removed realm and its dependencies. It's still throwing a Kotlin build error. I updated the gradle script above respectively and left the gradle build information below.
C:\Users\carre\Desktop\MBTA_99\MyApplication>gradlew assembleDebug --stacktrace
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preInstantrunconfigDebugBuild UP-TO-DATE
:app:checkInstantrunconfigDebugManifest
:app:preInstantrunconfigReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72321Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAdsLite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCastFramework940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesClearcut940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesContextmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGass940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIid940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlaces940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanager940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTagmanagerApi940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseConfig940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCrash940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabase940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseDatabaseConnection940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseMessaging940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorage940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseStorageCommon940Library UP-TO-DATE
:app:prepareComGoogleMapsAndroidAndroidMapsUtils044Library UP-TO-DATE
:app:prepareInstantrunconfigDebugDependencies
:app:compileInstantrunconfigDebugAidl UP-TO-DATE
:app:compileInstantrunconfigDebugRenderscript UP-TO-DATE
:app:generateInstantrunconfigDebugBuildConfig UP-TO-DATE
:app:mergeInstantrunconfigDebugShaders UP-TO-DATE
:app:compileInstantrunconfigDebugShaders UP-TO-DATE
:app:generateInstantrunconfigDebugAssets UP-TO-DATE
:app:mergeInstantrunconfigDebugAssets UP-TO-DATE
:app:generateInstantrunconfigDebugResValues UP-TO-DATE
:app:generateInstantrunconfigDebugResources UP-TO-DATE
:app:mergeInstantrunconfigDebugResources UP-TO-DATE
:app:processInstantrunconfigDebugManifest
:app:processInstantrunconfigDebugResources
:app:generateInstantrunconfigDebugSources
:app:incrementalInstantrunconfigDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileInstantrunconfigDebugKotlin
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class ninja.carre.mbta.activities.train_data.prediction_by_stop.Trip, unresolved supertypes: RealmObject
:app:compileInstantrunconfigDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileInstantrunconfigDebugKotlin'.
> Compilation error. See log for more details
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileInstantrunconfigDebugKotlin'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:66)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:153)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:150)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:40)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:237)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: org.gradle.api.GradleException: Compilation error. See log for more details
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile$callCompiler$10.invoke(Tasks.kt:355)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler(Tasks.kt:364)
at org.jetbrains.kotlin.gradle.tasks.KotlinCompile.callCompiler(Tasks.kt:148)
at org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile.execute(Tasks.kt:110)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:245)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:221)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:232)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 68 more
BUILD FAILED
Total time: 22.862 secs
There's a quite specific note in the official Realm documentation that if you use jackson-databind, you'll need to create a package called rx, and create an empty object in it called Observable
package rx;
public class Observable {
}
And then it'll work.
Although your message said something about "squareup", so who knows if this is actually the problem.
As for the above workaround, they tried removing it with the Realm Optional Transformer, but it caused issues with Dexguard so the workaround remained.
EDIT: Now it just says it cannot resolve RealmObject
:app:compileInstantrunconfigDebugKotlin
e: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class ninja.carre.mbta.activities.train_data.prediction_by_stop.Trip, unresolved supertypes: RealmObject
But you can try adding the following
android {
dexOptions {
incremental false
}
Along with disabling Instant Run
Try to update your build tool version....
compileSdkVersion 23
buildToolsVersion "23.0.3"
or download via SDK Manager.
I already know that question has been already asked very often and answers, but no one of the answers i found fixed my problem.
It's the error:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2321Library 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
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClas sFile.java:388)
at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
at com.android.dx.command.dexer.Main.processClass(Main.java:749)
... 12 more
1 error; aborting
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1
my gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "ppp.i2e.org.mppconversion"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.7
targetCompatibility = 1.7//JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
//compile 'net.sf.mpxj:mpxj:5.2.2'
//compile files('libs/mpxj.jar')
compile files('libs/MPPConverterJAR.jar')
}
Try to add java compatibility using this way i.e. File-> Project structure-> click on your module name-> open properties tab on top of that->change the source and target compatibility. Hope this will work. And remove compile options from gradle file.
and add vector compatibility if you are using gradle plugin 2.0+
android {
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
}
This question already has answers here:
Android Studio: Unexpected top level exception (finished with non-zero exit value 2..)
(3 answers)
Closed 7 years ago.
today i faced with this build error after trying to build my project, but i have changed nothing, it just popped from nowhere... or i simply don't remember what i have changed. I did one thing, updated build tools but i simply don't use the latest so it should bother the project.
Error:
Error:Execution failed for task ':DoToDoCourierApp:transformClassesWithDexForDebug'.
> com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2
Full log:
Information:Gradle tasks [:DoToDoCourierApp:generateDebugSources, :DoToDoCourierApp:generateDebugAndroidTestSources, :DoToDoCourierApp:assembleDebug]
:DoToDoCourierApp:preBuild UP-TO-DATE
:DoToDoCourierApp:preDebugBuild UP-TO-DATE
:DoToDoCourierApp:checkDebugManifest
:DoToDoCourierApp:preReleaseBuild UP-TO-DATE
:DoToDoEssentials:preBuild UP-TO-DATE
:DoToDoEssentials:preReleaseBuild UP-TO-DATE
:DoToDoEssentials:compileReleaseNdk UP-TO-DATE
:DoToDoEssentials:compileLint
:DoToDoEssentials:copyReleaseLint UP-TO-DATE
:DoToDoEssentials:checkReleaseManifest
:DoToDoEssentials:preDebugAndroidTestBuild UP-TO-DATE
:DoToDoEssentials:preDebugBuild UP-TO-DATE
:DoToDoEssentials:preDebugUnitTestBuild UP-TO-DATE
:DoToDoEssentials:preReleaseUnitTestBuild UP-TO-DATE
:DoToDoEssentials:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:DoToDoEssentials:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:DoToDoEssentials:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
:DoToDoEssentials:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:DoToDoEssentials:prepareComAndroidSupportSupportV132310Library UP-TO-DATE
:DoToDoEssentials:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:DoToDoEssentials:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE
:DoToDoEssentials:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE
:DoToDoEssentials:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
:DoToDoEssentials:prepareReleaseDependencies
:DoToDoEssentials:compileReleaseAidl UP-TO-DATE
:DoToDoEssentials:compileReleaseRenderscript UP-TO-DATE
:DoToDoEssentials:generateReleaseBuildConfig UP-TO-DATE
:DoToDoEssentials:generateReleaseAssets UP-TO-DATE
:DoToDoEssentials:mergeReleaseAssets UP-TO-DATE
:DoToDoEssentials:generateReleaseResValues UP-TO-DATE
:DoToDoEssentials:generateReleaseResources UP-TO-DATE
:DoToDoEssentials:mergeReleaseResources
AAPT err(Facade for 1745997574): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable-xhdpi\avatar_blank.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
AAPT err(Facade for 967998735): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable-xhdpi\logo_login.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
AAPT err(Facade for 1796841709): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable-xhdpi\car_avatar_blank.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
AAPT err(Facade for 1504354275): C:\android_studio_works\DoToDo_as\DoToDoEssentials\src\main\res\drawable\login_splash.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
:DoToDoEssentials:processReleaseManifest UP-TO-DATE
:DoToDoEssentials:processReleaseResources UP-TO-DATE
:DoToDoEssentials:generateReleaseSources UP-TO-DATE
:DoToDoEssentials:compileReleaseJavaWithJavac UP-TO-DATE
:DoToDoEssentials:extractReleaseAnnotations UP-TO-DATE
:DoToDoEssentials:mergeReleaseProguardFiles UP-TO-DATE
:DoToDoEssentials:processReleaseJavaRes UP-TO-DATE
:DoToDoEssentials:packageReleaseJar UP-TO-DATE
:DoToDoEssentials:packageReleaseJniLibs UP-TO-DATE
:DoToDoEssentials:packageReleaseLocalJar UP-TO-DATE
:DoToDoEssentials:packageReleaseRenderscript UP-TO-DATE
:DoToDoEssentials:packageReleaseResources
:DoToDoEssentials:bundleRelease UP-TO-DATE
:DoToDoCourierApp:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:DoToDoCourierApp:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:DoToDoCourierApp:prepareComAndroidSupportMediarouterV72220Library UP-TO-DATE
:DoToDoCourierApp:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:DoToDoCourierApp:prepareComAndroidSupportSupportV132310Library UP-TO-DATE
:DoToDoCourierApp:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:DoToDoCourierApp:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServices810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAds810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAnalytics810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAppindexing810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAppinvite810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesAppstate810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesBase810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesBasement810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesCast810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesDrive810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesFitness810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesGames810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesGcm810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesIdentity810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesLocation810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesMaps810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesMeasurement810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesNearby810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesPanorama810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesPlus810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesSafetynet810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesVision810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesWallet810Library UP-TO-DATE
:DoToDoCourierApp:prepareComGoogleAndroidGmsPlayServicesWearable810Library UP-TO-DATE
:DoToDoCourierApp:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
:DoToDoCourierApp:prepareDoToDo_asDoToDoEssentialsUnspecifiedLibrary UP-TO-DATE
:DoToDoCourierApp:prepareDebugDependencies
:DoToDoCourierApp:compileDebugAidl UP-TO-DATE
:DoToDoCourierApp:compileDebugRenderscript UP-TO-DATE
:DoToDoCourierApp:generateDebugBuildConfig UP-TO-DATE
:DoToDoCourierApp:generateDebugAssets UP-TO-DATE
:DoToDoCourierApp:mergeDebugAssets UP-TO-DATE
:DoToDoCourierApp:generateDebugResValues UP-TO-DATE
:DoToDoCourierApp:processDebugGoogleServices
:DoToDoCourierApp:generateDebugResources
:DoToDoCourierApp:mergeDebugResources UP-TO-DATE
:DoToDoCourierApp:processDebugManifest UP-TO-DATE
:DoToDoCourierApp:processDebugResources UP-TO-DATE
:DoToDoCourierApp:generateDebugSources UP-TO-DATE
:DoToDoCourierApp:preDebugAndroidTestBuild UP-TO-DATE
:DoToDoCourierApp:prepareDebugAndroidTestDependencies
:DoToDoCourierApp:compileDebugAndroidTestAidl UP-TO-DATE
:DoToDoCourierApp:processDebugAndroidTestManifest UP-TO-DATE
:DoToDoCourierApp:compileDebugAndroidTestRenderscript UP-TO-DATE
:DoToDoCourierApp:generateDebugAndroidTestBuildConfig UP-TO-DATE
:DoToDoCourierApp:generateDebugAndroidTestAssets UP-TO-DATE
:DoToDoCourierApp:mergeDebugAndroidTestAssets UP-TO-DATE
:DoToDoCourierApp:generateDebugAndroidTestResValues UP-TO-DATE
:DoToDoCourierApp:generateDebugAndroidTestResources UP-TO-DATE
:DoToDoCourierApp:mergeDebugAndroidTestResources UP-TO-DATE
:DoToDoCourierApp:processDebugAndroidTestResources UP-TO-DATE
:DoToDoCourierApp:generateDebugAndroidTestSources UP-TO-DATE
:DoToDoCourierApp:compileDebugJavaWithJavac UP-TO-DATE
:DoToDoCourierApp:compileDebugNdk UP-TO-DATE
:DoToDoCourierApp:compileDebugSources UP-TO-DATE
:DoToDoCourierApp:transformClassesAndResourcesWithExtractJarsForDebug UP-TO-DATE
:DoToDoCourierApp:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task ':DoToDoCourierApp:transformClassesWithDexForDebug'.
> com.android.build.transform.api.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2
I got 3 modules. In the first one is basically a library 'holder' it contains all the compiled libs. The 2 other are 2 application which uses the libraries.
DoToDoEssentials: library module, containing all the compiled libs
DoToDoCourier: App module
DoToDoSender: App module
Here are the gradle files:
Top level build.gradle for project:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.google.gms:google-services:1.4.0-beta3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
DoToDoEssentials module gradle file:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories { mavenCentral() }
dependencies {
compile 'com.android.support:appcompat-v7:23.+' //appcompat activity for navigation drawer
compile 'com.android.support:design:23.+' //support for pre Android L desing views
compile 'com.android.support:support-v13:23.+' //support for pre Android L other
compile 'com.google.android.gms:play-services:8.1.0' //google maps
compile 'com.facebook.android:facebook-android-sdk:4.6.0' //facebook lib
compile 'de.hdodenhof:circleimageview:2.0.0' //circle image view
compile 'com.squareup.picasso:picasso:2.5.2' //image downloader lib
compile 'com.google.code.gson:gson:2.4' //gson for serialization
compile 'com.squareup.okhttp:okhttp-android-support:2.5.0' //networking lib bugfix lib ..? kell ez ?
compile 'com.squareup.okio:okio:1.6.0' //okhttp dependency
compile 'com.squareup.okhttp:okhttp:2.5.0' //networking lib
compile 'com.googlecode.libphonenumber:libphonenumber:5.5' //phone number validation library
compile fileTree(dir: 'libs', include: ['*.jar'])
}
DoToDoCourier app gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.illion.dotodo.application.courier"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories { mavenCentral() }
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':DoToDoEssentials')
}
DoToDoSender App gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.illion.dotodo.application.sender"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories { mavenCentral() }
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':DoToDoEssentials')
}
I have used this scheme for months and it was worked and now today something happened and i cannot build without error.
So and what should i do with:
ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2
No hint, no concrete error, just an exception.
What i have tried:
Clean project
Rebuild Project
Run project
Invalidate caches/Restart
Load an older commit
But the issue is still present.
I use Android Studio 1.4
Please help if you can.
370 views and still no response after a month.
I was able to reproduce this strange thing that happens after you either update build tools or try to make your app multidex. You will usually get some TransformException (gradle inner exception) which does not tell you much, but and after you compile with --info --debug you will probably notice that it's an error with GC overhead (it's out of memory).
For the fix of the memory limit you can check related thread here on SO: Android Studio Google JAR file causing GC overhead limit exceeded error but if you need quick fix, add this javaMaxHeapSize to your dexOptions as follows:
android {
...
dexOptions {
incremental = true;
preDexLibraries = false
javaMaxHeapSize "4g" // 2g should be also OK
}
...
}
PS: for some explanation of the options see this thread: how can I use Android dexOptions?
I'm new on Android Studio since I've used Eclipse till now. Now I'm trying to import two libraries (MPChartLib and datetimepicker-library) as a jar.
The steps I did:
1. Create a folder called libraries
2. Drag and drop the jars to the folder
3. Right click on them --> Add to library (something like that)
(As I have seen on some tutorials)
The system recognizes those jars and I am able to work with them. But when I want to run the project, I get the following error:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72100Library UP-TO-DATE
:app:prepareComAndroidSupportGridlayoutV72100Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72100Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72100Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42100Library 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:compileDebugJava UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug
Error:duplicate files during packaging of APK
C:\Users\Markus\Documents\AndroidStudiosWORKSPACE\TestProject\app\build\outputs\apk\app-debug- unaligned.apk
Path in archive: res/values/colors.xml
Origin 1: C:\Users\Markus\Documents\AndroidStudiosWORKSPACE\TestProject\app\libraries\datetimepicker-library.jar
Origin 2: C:\Users\Markus\Documents\AndroidStudiosWORKSPACE\TestProject\app\libraries\MPChartLib.jar
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'res/values/colors.xml'
}
}
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK res/values/colors.xml
File 1: C:\Users\Markus\Documents\AndroidStudiosWORKSPACE\TestProject\app\libraries\datetimepicker-library.jar
File 2: C:\Users\Markus\Documents\AndroidStudiosWORKSPACE\TestProject\app\libraries\datetimepicker-library.jar
It's not the first time I get this error, so I have searched for a solution for hours - vainly.
The following is my build.gradle where I have already excluded many files:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
packagingOptions {
exclude 'AndroidManifest.xml'
exclude 'bin/AndroidManifest.xml'
exclude 'bin/R.txt'
exclude 'bin/jarlist.cache'
exclude 'build.gradle'
exclude 'proguard-project.txt'
exclude 'project.properties'
}
defaultConfig {
applicationId "com.nomax.gymdiary"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:gridlayout-v7:21.0.0'
compile 'com.android.support:mediarouter-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile files('libraries/datetimepicker-library.jar')
compile files('libraries/MPChartLib.jar')
}
I'm sure that I don't have to exclude those important files (which can be seen on latest error where I also have to exclude res/values/colors.xml)
Greetings from Austria!
PS: I have exported the libs from an android project from Eclipse to a jar file. Can this be the problem?