Gradle Build taking too long too complete - android

My gradle build is taking over 9 minutes to complete.
It was taking about less than a minute before which was ok. I dont know what went wrong.
I have tried a lot of adjustments and recommendations.
Gradle 4.4
my project level gradle is as follows
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My app gradle build file is as follows
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries = false
maxProcessCount 8
}
defaultConfig {
applicationId "com.teamnifi.nifi"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
implementation 'io.reactivex:rxandroid:1.2.0'
implementation 'io.reactivex:rxjava:1.1.8'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.android.support:preference-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.nkzawa:socket.io-client:0.3.0'
//noinspection GradleCompatible
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation "com.andkulikov:transitionseverywhere:1.8.0"
testImplementation 'junit:junit:4.12'
android {
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}
}
}
apply plugin: 'com.google.gms.google-services'
And my gradle project properties is as follows
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx4608m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide /multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true
Offline work is selected in settings under gradle.
i have tried turning that off and syncing then turning it back on and building
The output off the latest build is as follows with offline work on in settings.
Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
Parallel execution with configuration on demand is an incubating feature.
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
:clean UP-TO-DATE
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:checkDebugManifest
:app:generateDebugBuildConfig
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug
:app:generateDebugResValues
:app:generateDebugResources
:app:processDebugGoogleServices
Parsing json file: C:\Users\Josh\AndroidStudioProjects\NIFI\app\google-services.json
:app:mergeDebugResources
:app:createDebugCompatibleScreenManifests
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug
:app:processDebugResources
:app:generateDebugSources
:app:preDebugAndroidTestBuild
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mainApkListPersistenceDebugAndroidTest
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:mockableAndroidJar
BUILD SUCCESSFUL in 9m 44s
26 actionable tasks: 24 executed, 2 up-to-date
My gradle sync also takes over 15 minutes to complete.
All the while i have another project in android studio that runs normally and takes significantly less time to sync and build.

So the problem was a bunch of viruses and malware on my system. After running a boot time scan on my system i ran the build and now its back to taking a minute to run.

Related

Error when multiple libraries use diferent versions of the same external library in gradle

I'm facing some problems when updating the external libraries that my app uses. Here are the gradle files:
Project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.31'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
daggerVersion = "2.13"
supportVersion = "27.1.1"
}
Application build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.myapp"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation "com.android.support:cardview-v7:$supportVersion"
implementation "com.android.support:design:$supportVersion"
implementation "com.android.support:animated-vector-drawable:$supportVersion"
implementation "com.android.support:support-fragment:$supportVersion"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-analytics:12.0.1'
// implementation 'com.android.support:multidex:1.0.3'
// Google Sign In SDK (only required for Google Sign In)
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.hannesdorfmann.mosby3:mvp-lce:3.0.4'
implementation 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
kapt 'com.github.bumptech.glide:compiler:4.6.1'
// Firebase UI
// Used in FirebaseUIActivity. The FirebaseUI-Android library has a minSdk level of 16
// so this library is only included in the minSdkJellybean variant.
implementation 'com.firebaseui:firebase-ui-auth:3.2.1'
// Facebook Android SDK (only required for Facebook Login)
// Used in FacebookLoginActivity. This is only compiled into the minSdkJellybean variant of this
// app. You can build a 'minSdkGingerbread' variant to test on devices with 9 <= SDK <= 15.
implementation 'com.facebook.android:facebook-login:4.31.0'
implementation "com.android.support:customtabs:$supportVersion"
// Twitter Android SDK (only required for Twitter Login)
// implementation('com.twitter.sdk.android:twitter-core:3.2.0#aar') {
// transitive = true
// }
// implementation('com.twitter.sdk.android:twitter:3.2.0#aar') {
// transitive = true
// }
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
// Dagger
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-compiler:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android:$rootProject.daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$rootProject.daggerVersion"
implementation "com.google.dagger:dagger-android-support:$rootProject.daggerVersion"
// Room
implementation "android.arch.persistence.room:runtime:1.0.0"
kapt "android.arch.persistence.room:compiler:1.0.0"
implementation "android.arch.lifecycle:common-java8:1.1.1"
// RxJava
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.6'
// compile 'io.reactivex.rxjava2:rxkotlin:2.2.0'
// RxFirebase
implementation('com.github.b3er.rxfirebase:firebase-database:11.2.0') {
transitive = false
}
// // PhotoView
// implementation 'com.github.chrisbanes:PhotoView:2.1.3'
// ucrop
// implementation 'com.github.yalantis:ucrop:2.2.2'
}
apply plugin: 'com.google.gms.google-services'
But when I try to run the application I get the following error:
Executing tasks: [:app:assembleDebug]
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
app: 'annotationProcessor' dependencies won't be recognized as kapt annotation processors. Please change the configuration name to 'kapt' for these artifacts: 'com.github.bumptech.glide:compiler:4.6.1'.
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: /Users/joan/Development/myapp/git/myapp-android/app/google-services.json
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:kaptGenerateStubsDebugKotlin
:app:kaptDebugKotlin
w: Note: [1] Wrote GeneratedAppGlideModule with: []
w: warning: Supported source version 'RELEASE_7' from annotation processor 'org.jetbrains.kotlin.kapt3.ProcessorWrapper' less than -source '1.8'
w: /Users/joan/Development/myapp/git/myapp-android/app/build/tmp/kapt3/stubs/debug/com/myapp/model/ApplicationDatabase.java:7: warning: Schema export directory is not provided to the annotation processor so we cannot export the schema. You can either provide `room.schemaLocation` annotation processor argument OR set exportSchema to false.
public abstract class ApplicationDatabase extends android.arch.persistence.room.RoomDatabase {
^
:app:compileDebugKotlin
:app:prepareLintJar UP-TO-DATE
:app:generateDebugSources
:app:javaPreCompileDebug
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileDebugJavaWithJavac
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:packageInstantRunResourcesDebug
:app:validateSigningDebug
:app:processInstantRunDebugResourcesApk
:app:checkManifestChangesDebug
:app:transformClassesWithStackFramesFixerForDebug
:app:transformClassesWithDesugarForDebug
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithDependencyCheckerForDebug
:app:compileDebugNdk NO-SOURCE
:app:mergeDebugJniLibFolders
:app:transformNativeLibsWithMergeJniLibsForDebug
:app:processDebugJavaRes NO-SOURCE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformNativeLibsAndResourcesWithJavaResourcesVerifierForDebug
:app:transformClassesWithInstantRunForDebug
:app:transformClassesEnhancedWithInstantReloadDexForDebug
:app:incrementalDebugTasks
:app:preColdswapDebug
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexBuilderForDebug
AGPBI: {"kind":"error","text":"Program type already present: android.arch.lifecycle.LiveData$1","sources":[{}],"tool":"D8"}
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/0.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/1.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/2.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/3.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/4.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/5.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/6.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/7.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/8.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/9.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/10.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/11.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/12.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/13.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/14.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/15.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/16.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/17.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/18.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/19.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/20.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/21.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/22.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/23.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/24.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/25.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/26.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/27.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/28.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/29.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/30.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/31.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/32.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/33.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/34.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/35.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/36.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/37.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/38.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/39.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/40.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/41.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/42.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/43.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/44.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/45.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/46.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/47.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/48.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/49.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/50.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/51.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/52.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/53.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/54.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/55.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/56.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/57.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/58.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/59.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/60.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/61.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/62.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/63.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/64.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/65.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/66.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/67.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/68.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/69.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/70.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/71.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/72.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/73.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/74.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/75.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/76.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/77.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/78.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/79.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/80.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/81.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/82.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/83.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/84.jar, /Users/joan/Development/myapp/git/myapp-android/app/build/intermediates/transforms/dexBuilder/debug/85.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 22s
45 actionable tasks: 34 executed, 11 up-to-date
But if I change the supportVersion to 27.0.2 everything works fine until I add an other library (implementation 'com.github.yalantis:ucrop:2.2.2'), then I have the same issue. It looks like each library is using different versions of other libs I use, but I don't know how to solve this issue. Any help?

DBFlow - Gradle cannot find symbol DatabaseHolder when using multiple modules

i need help with a problem using DBFlow 4.0.0-beta3 and Gradle 2.2.3 in my module app of an Android Studio project; i have two modules (app, notifications) that uses DBFlow so i configure them like is indicated in the usage of the library, the notifications module compiles whell and generates the DatabaseHolder class, then the compiler goes to app and throws the exception:
error: cannot find symbol
import com.raizlabs.android.dbflow.config.SamsungGeneratedDatabaseHolder;
But that class is generated successfully, this is my gradle output:
Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources, :notifications:generateDebugSources, :notifications:generateDebugAndroidTestSources, :notifications:mockableAndroidJar, :notifications:prepareDebugUnitTestDependencies, :notifications:compileDebugSources, :notifications:compileDebugAndroidTestSources, :notifications:compileDebugUnitTestSources, :sapservice:generateDebugSources, :sapservice:generateDebugAndroidTestSources, :sapservice:mockableAndroidJar, :sapservice:prepareDebugUnitTestDependencies, :sapservice:compileDebugSources, :sapservice:compileDebugAndroidTestSources, :sapservice:compileDebugUnitTestSources]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean
:app:clean
:notifications:clean
:sapapi:clean
:sapprocessor:clean
:sapservice:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:notifications:preBuild UP-TO-DATE
:notifications:preReleaseBuild UP-TO-DATE
:notifications:checkReleaseManifest
:notifications:preDebugAndroidTestBuild UP-TO-DATE
:notifications:preDebugBuild UP-TO-DATE
:notifications:preDebugUnitTestBuild UP-TO-DATE
:notifications:preReleaseUnitTestBuild UP-TO-DATE
:notifications:prepareComAndroidSupportAnimatedVectorDrawable2511Library
:notifications:prepareComAndroidSupportAppcompatV72511Library
:notifications:prepareComAndroidSupportSupportCompat2511Library
:notifications:prepareComAndroidSupportSupportCoreUi2511Library
:notifications:prepareComAndroidSupportSupportCoreUtils2511Library
:notifications:prepareComAndroidSupportSupportFragment2511Library
:notifications:prepareComAndroidSupportSupportMediaCompat2511Library
:notifications:prepareComAndroidSupportSupportV42511Library
:notifications:prepareComAndroidSupportSupportVectorDrawable2511Library
:notifications:prepareComGithubRaizlabsDBFlowDbflow400Beta3Library
:notifications:prepareComGithubRaizlabsDBFlowDbflowKotlinextensions400Beta3Library
:notifications:prepareIoReactivexRxjava2Rxandroid201Library
:notifications:prepareNetDanlewAndroidJoda2942Library
:notifications:prepareReleaseDependencies
:notifications:compileReleaseAidl
:notifications:compileReleaseNdk UP-TO-DATE
:notifications:compileLint
:notifications:copyReleaseLint UP-TO-DATE
:notifications:compileReleaseRenderscript
:notifications:generateReleaseBuildConfig
:notifications:generateReleaseResValues
:notifications:generateReleaseResources
:notifications:mergeReleaseResources
:notifications:processReleaseManifest
:notifications:processReleaseResources
:notifications:generateReleaseSources
:notifications:incrementalReleaseJavaCompilationSafeguard
:notifications:compileReleaseKotlin
:notifications:compileReleaseJavaWithJavac
Destination for generated sources was modified by kapt. Previous value = /home/diego/Documents/development/mobile/android/samsung-club/notifications/build/generated/source/apt/release
:notifications:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
warning: File for type 'com.raizlabs.android.dbflow.config.NotificationsRegisterDatabaseNotificationsRegisterDatabase_Database' created in the last round will not be subject to annotation processing.
warning: File for type 'com.raizlabs.android.dbflow.config.NotificationsModuleGeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.
2 warnings
:notifications:compileReleaseKotlinAfterJava
:notifications:copyReleaseKotlinClasses
:notifications:extractReleaseAnnotations
:notifications:mergeReleaseShaders
:notifications:compileReleaseShaders
:notifications:generateReleaseAssets
:notifications:mergeReleaseAssets
:notifications:mergeReleaseProguardFiles UP-TO-DATE
:notifications:packageReleaseRenderscript UP-TO-DATE
:notifications:packageReleaseResources
:notifications:processReleaseJavaRes UP-TO-DATE
:notifications:transformResourcesWithMergeJavaResForRelease
:notifications:transformClassesAndResourcesWithSyncLibJarsForRelease
:notifications:mergeReleaseJniLibFolders
:notifications:transformNative_libsWithMergeJniLibsForRelease
:notifications:transformNative_libsWithSyncJniLibsForRelease
:notifications:bundleRelease
:app:prepareComAndroidSupportAnimatedVectorDrawable2511Library
:app:prepareComAndroidSupportAppcompatV72511Library
:app:prepareComAndroidSupportCardviewV72511Library
:app:prepareComAndroidSupportDesign2511Library
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportPercent2511Library
:app:prepareComAndroidSupportRecyclerviewV72511Library
:app:prepareComAndroidSupportSupportCompat2511Library
:app:prepareComAndroidSupportSupportCoreUi2511Library
:app:prepareComAndroidSupportSupportCoreUtils2511Library
:app:prepareComAndroidSupportSupportFragment2511Library
:app:prepareComAndroidSupportSupportMediaCompat2511Library
:app:prepareComAndroidSupportSupportV42511Library
:app:prepareComAndroidSupportSupportVectorDrawable2511Library
:app:prepareComAndroidSupportTransition2511Library
:app:prepareComAppsflyerAfAndroidSdk467Library
:app:prepareComCrashlyticsSdkAndroidAnswers136Library
:app:prepareComCrashlyticsSdkAndroidBeta114Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics255Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsNdk111Library
:app:prepareComDaimajiaSwipelayoutLibrary120Library
:app:prepareComFacebookAndroidFacebookAndroidSdk470Library
:app:prepareComGithubAfollestadMaterialDialogsCore0857Library
:app:prepareComGithubRaizlabsDBFlowDbflow400Beta3Library
:app:prepareComGithubRaizlabsDBFlowDbflowKotlinextensions400Beta3Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics961Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalyticsImpl961Library
:app:prepareComGoogleAndroidGmsPlayServicesBase961Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement961Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm961Library
:app:prepareComGoogleAndroidGmsPlayServicesIid961Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation961Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps961Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks961Library
:app:prepareComGoogleFirebaseFirebaseAnalytics961Library
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl961Library
:app:prepareComGoogleFirebaseFirebaseCommon961Library
:app:prepareComGoogleFirebaseFirebaseCore961Library
:app:prepareComGoogleFirebaseFirebaseIid961Library
:app:prepareComGoogleMapsAndroidAndroidMapsUtils043Library
:app:prepareComKarumiDexter231Library
:app:prepareComTwitterSdkAndroidTweetComposer200Library
:app:prepareComTwitterSdkAndroidTweetUi200Library
:app:prepareComTwitterSdkAndroidTwitter200Library
:app:prepareComTwitterSdkAndroidTwitterCore200Library
:app:prepareIoFabricSdkAndroidFabric1313Library
:app:prepareIoReactivexRxandroid121Library
:app:prepareIoReactivexRxjava2Rxandroid201Library
:app:prepareMeZhanghaiAndroidMaterialprogressbarLibrary115Library
:app:prepareNetDanlewAndroidJoda2942Library
:app:prepareSamsungClubGeoreferencedpushnotificationsReleaseUnspecifiedLibrary
:app:prepareSamsungClubNotificationsUnspecifiedLibrary
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:processDebugManifest
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues
:app:processDebugGoogleServices
Parsing json file: /home/diego/Documents/development/mobile/android/samsung-club/app/google-services.json
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestResValues
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
/home/diego/Documents/development/mobile/android/samsung-club/app/src/main/java/com/creardigitalm/samsungclub/controller/fragment/MyBenefitsFragment.java:28: error: cannot find symbol
import com.raizlabs.android.dbflow.config.SamsungGeneratedDatabaseHolder;
^
symbol: class SamsungGeneratedDatabaseHolder
location: package com.raizlabs.android.dbflow.config
warning: File for type 'com.raizlabs.android.dbflow.config.SamsungClubDatabaseSamsungDB_Database' created in the last round will not be subject to annotation processing.
warning: File for type 'com.raizlabs.android.dbflow.config.SamsungGeneratedDatabaseHolder' created in the last round will not be subject to annotation processing.
1 error
2 warnings
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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.914 secs
Like you can see the compiler try to find the import class and then generate the classes i will post my app gradle.build (i switch from apt to annotationProcessor):
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath 'org.aspectj:aspectjtools:1.8.5'
}
}
apply plugin: 'com.android.application'
//apply plugin: 'kotlin-android'
//apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
android {
compileSdkVersion 25
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "com.creardigitalm.samsungclub"
minSdkVersion 18
targetSdkVersion 25
versionCode 69
versionName '1.5.5.0'
//multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
arguments = [ targetModuleName : 'Samsung']
}
}
}
buildTypes {
debug {
resValue("bool", "is_debug", "true")
}
release {
resValue("bool", "is_debug", "false")
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
packagingOptions {
//exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/rxjava.properties'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
/*apt {
arguments {
targetModuleName 'Samsung'
}
}*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
/*---- GOOGLE SUPPORT LIBRARIES ----*/
// MATERIAL DESIGN
compile "com.android.support:appcompat-v7:$support_version"
compile "com.android.support:support-v4:$support_version"
compile "com.android.support:design:$support_version"
compile "com.android.support:cardview-v7:$support_version"
// PERCENT RELATIVE LAYOUT
compile "com.android.support:percent:${support_version}"
//MATERIAL DIALOGS
compile('com.github.afollestad.material-dialogs:core:0.8.5.7#aar') {
transitive = true
}
/*----------------------------------*/
//SWIPE LIST
// Swipe layout https://github.com/daimajia/AndroidSwipeLayout
compile "com.daimajia.swipelayout:library:1.2.0#aar"
//PICASSO
compile 'com.squareup.picasso:picasso:2.5.2'
/*------ DEPENDENCY INJECTION ------*/
// ButterKnife utils http://jakewharton.github.io/butterknife/
compile 'com.jakewharton:butterknife:7.0.1'
// Parceler https://github.com/johncarl81/parceler
compile 'org.parceler:parceler-api:1.1.4'
annotationProcessor 'org.parceler:parceler:1.1.4'
/*----------------------------------*/
/*------- REST - NETWORKING -------*/
// Retrofit http://square.github.io/retrofit/
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
// OkHttp http://square.github.io/okhttp/
compile 'com.squareup.okhttp3:okhttp:3.4.1'
/*----------------------------------*/
/*------------ GOOGLE --------------*/
//Google Map Utils.
compile 'com.google.maps.android:android-maps-utils:0.4.3'
//Google Cloud Message
compile 'com.google.android.gms:play-services-gcm:9.6.1'
//Google Location
compile 'com.google.android.gms:play-services-location:9.6.1'
//Google Maps
compile 'com.google.android.gms:play-services-maps:9.6.1'
//Google Analytics
compile 'com.google.android.gms:play-services-analytics:9.6.1'
/*----------------------------------*/
/*------------ FABRIC --------------*/
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.1#aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:answers:1.3.3#aar') {
transitive = true;
}
/*----------------------------------*/
/*----------- ANALYTICS ------------*/
//Appsflyer
compile 'com.appsflyer:af-android-sdk:4+#aar'
/*----------------------------------*/
/*------------ FACEBOOK ------------*/
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
/*----------------------------------*/
/*------------- TWITTER -------------*/
compile('com.twitter.sdk.android:twitter:2.0.0#aar') {
transitive = true;
}
/*----------------------------------*/
/*--------- GEO FENCED PUSH --------*/
compile project(':georeferencedpushnotifications-release')
/*compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'net.danlew:android.joda:2.9.4.2'
compile "com.github.Raizlabs.DBFlow:dbflow-kotlinextensions:$dbflow_version"*/
/*----------------------------------*/
/*---------- NOTIFICATIONS ---------*/
compile project(':notifications')
/*----------------------------------*/
/*------------ SECURITY ------------*/
// Dexter https://github.com/Karumi/Dexter
compile 'com.karumi:dexter:2.3.1'
/*----------------------------------*/
/*--------------- RX ---------------*/
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.2.1'
/*----------------------------------*/
/*------------ MULTIDEX ------------*/
compile 'com.android.support:multidex:1.0.1'
/*----------------------------------*/
/*-------------- DBFLOW ------------*/
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:$dbflow_version"
compile "com.github.Raizlabs.DBFlow:dbflow-core:$dbflow_version"
compile "com.github.Raizlabs.DBFlow:dbflow:$dbflow_version"
/*----------------------------------*/
/*------- SAPAPI PARA GEAR S2 ------*/
/*compile project(':sapservice')
apt project(':sapprocessor')
compile 'org.aspectj:aspectjrt:1.8.5'*/
/*----------------------------------*/
}
apply plugin: 'com.google.gms.google-services'
crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}

Android Studio 2.1.2 - too slow to build

I have dell inspiron N4010 laptop with Intel Core i5 CPU M 480 # 2.67GHz, 4GB RAM, 500GB Hard disk running ubuntu 16.04LTS - 64bit OS. I have been developing Android Apps in Android Studio 1.5+ Version. Now migrated to Android Studio 2.1.2. Everything was smooth in previous versions of AS in my Laptop.
Building Apps in the latest version is too slow; takes 30seconds to 1.5 minutes to build - only while editing xml files. If I made any change in Java files, then build time went to 10 minutes.
So, I formatted the hard disk to ext4 and installed ubuntu 16.04(Single OS) - 500GB fully...
Downloaded and installed Android Studio 2.1.2 and Oracle jdk 8. Still it takes 10 minutes for every time I change any java files.
Here is my app(module) gradle file:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.gmail.balavickey1192"
minSdkVersion 16
targetSdkVersion 24
versionCode 300
versionName "2.0"
multiDexEnabled true
}
dexOptions {
incremental true
preDexLibraries true
javaMaxHeapSize "10g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url 'http://repo.brightcove.com/releases'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile 'com.roughike:bottom-bar:1.4.0.1'
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.brightcove.player:exoplayer:4.8.2'
}
Project level gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have tried to search from internet and found some solutions. Here is my gradle.properties file:
org.gradle.jvmargs=-Xmx11000m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.daemon=true
And also disabled few plugins:
CVS integration
Git
Github
Google cloud tools
Subversion Integration
Changed following settings to checked mark by File->Settings->Build,Execution,Deplyment--->
Global Gradle settings- offline work
Compiler- Compile independent modules
- Make project automatically
- command line options: --offline --profile --parallel
- Use in-process build
- Configure on demand
Instant run - unchecked(disabled) everything in that tab.
Still it is too slow... 8 to 10 minutes!
So decided to build via command line; closed every apps even android studio, firefox and everything.
./gradlew assembleDebug --profile -- offline
first time, it said subsequent builds will be faster. Now build time decreased to 3 to 4 minutes...
Here is the report generated while building:
:app 6m47.94s (total)
:app:transformClassesWithDexForDebug 4m7.32s
:app:packageDebug 1m24.23s
:app:mergeDebugJniLibFolders 21.533s UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug 14.906s
:app:transformNative_libsWithMergeJniLibsForDebug 10.125s UP-TO-DATE
:app:compileDebugJavaWithJavac 9.781s
:app:validateDebugSigning 6.251s
:app:transformClassesWithJarMergingForDebug 4.309s
:app:transformResourcesWithMergeJavaResForDebug 3.707s UP-TO-DATE
:app:zipalignDebug 3.657s
:app:processDebugJavaRes 0.543s UP-TO-DATE
:app:mergeDebugResources 0.302s UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72400Library 0.146s UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2400Library 0.121s UP-TO-DATE
:app:processDebugManifest 0.076s UP-TO-DATE
:app:generateDebugBuildConfig 0.062s UP-TO-DATE
:app:processDebugResources 0.061s UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72400Library 0.054s UP-TO-DATE
:app:assembleDebug 0.051s Did No Work
:app:prepareComAndroidSupportMediarouterV72300Library 0.050s UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk4141Library 0.044s UP-TO-DATE
:app:prePackageMarkerForDebug 0.041s
:app:prepareComGoogleAndroidGmsPlayServicesAds900Library 0.041s UP-TO-DATE
Total Build Time 7m37.73s
Startup 6.695s
Settings and BuildSrc 0.738s
Loading Projects 0.533s
Configuring Projects 10.535s
Task Execution 6m47.94s
Here is my system monitor screen captured while building gradle via terminal:
The same project runs smoothly on another HP Laptop with same configurations(i5, 4GB RAM, 500GB HDD, ubuntu 16.04-64 bit OS), same tools: Android Studio 2.1.2, oracle jdk-8; takes only very few seconds to build and run on that machine.
But for mine, the whole system hangs; Can't do anything while building either from Android Studio or from terminal.
Please help me guys...

Android studio minify enabled = true , not able to generate apk?

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'realm-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultPublishConfig "debug"
defaultConfig {
applicationId "com.youth4work.ibps"
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 1
versionName "1.0.0"
}
signingConfigs {
release {
storeFile file('keystore/youth4work_second_key')
keyAlias 'youth4work_second_key_alias'
keyPassword "youth4work"
storePassword "youth4work"
}
debug {
storeFile file('keystore/debug.keystore')
keyAlias 'androiddebugkey'
storePassword 'android'
keyPassword 'android'
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
versionNameSuffix "Debug"
debuggable true
}
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
retrolambda {
jvmArgs '-noverify'
}
dependencies {
final PLAY_SERVICES_VERSION = '8.3.0'
final SUPPORT_LIBRARY_VERSION = '23.3.0'
// Google Play Services
compile "com.google.android.gms:play-services-base:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services- analytics:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
compile "com.google.android.gms:play-services-plus:$PLAY_SERVICES_VERSION"
// Support Libraries
compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
compile 'com.android.support:support-annotations:23.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.jakewharton.timber:timber:4.1.0'
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.github.kevinsawicki:timeago:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.8.2'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.mobsandgeeks:android-saripaar:2.0.2'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'
compile 'com.github.jakob-grabner:Circle-Progress-View:1.2.8'
compile 'com.github.vlonjatg:progress-activity:v1.0.3'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.daasuu:animateHorizontalProgressBar:0.2.2'
compile 'io.reactivex:rxjava:1.1.0'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'com.trello:rxlifecycle:0.4.0'
compile 'com.trello:rxlifecycle-components:0.4.0'
compile('com.github.afollestad.material-dialogs:core:0.8.5.6#aar') {
transitive = true
}
compile('com.mikepenz:fastadapter:1.4.0#aar') {
transitive = true
}
testCompile 'junit:junit:4.12'
}
// Log out test results to console
tasks.matching { it instanceof Test }.all {
testLogging.events = ["failed", "passed", "skipped"]
}
here if i make minify enabled = false the code runs fine while if i use true the code shows
Information:Gradle tasks [:app:assembleRelease] google-services plugin
could not detect any version for com.google.android.gms, default
version: 8.3.0 will be used. please apply google-services plugin at
the bottom of the build file. :app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE :app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2330Library
UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72330Library
UP-TO-DATE :app:prepareComAndroidSupportCardviewV72330Library
UP-TO-DATE :app:prepareComAndroidSupportDesign2330Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42330Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2330Library
UP-TO-DATE :app:prepareComDaasuuAnimateHorizontalProgressBar022Library
UP-TO-DATE :app:prepareComFacebookAndroidFacebookAndroidSdk482Library
UP-TO-DATE
:app:prepareComGithubAfollestadMaterialDialogsCore0856Library
UP-TO-DATE
:app:prepareComGithubJakobGrabnerCircleProgressView128Library
UP-TO-DATE :app:prepareComGithubSiyamedAndroidShapeImageview093Library
UP-TO-DATE :app:prepareComGithubVlonjatgProgressActivityV103Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics830Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesBase830Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement830Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesGcm830Library
UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement830Library
UP-TO-DATE :app:prepareComGoogleAndroidGmsPlayServicesPlus830Library
UP-TO-DATE :app:prepareComJakewhartonRxbindingRxbinding040Library
UP-TO-DATE :app:prepareComJakewhartonTimberTimber410Library UP-TO-DATE
:app:prepareComJoanzapataIconifyAndroidIconify211Library UP-TO-DATE
:app:prepareComJoanzapataIconifyAndroidIconifyFontawesome211Library
UP-TO-DATE :app:prepareComMikepenzFastadapter140Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:app:prepareComTrelloRxlifecycle040Library UP-TO-DATE
:app:prepareComTrelloRxlifecycleComponents040Library UP-TO-DATE
:app:prepareIoReactivexRxandroid110Library UP-TO-DATE
:app:prepareIoRealmRealmAndroidLibrary0883Library UP-TO-DATE
:app:prepareMeZhanghaiAndroidMaterialprogressbarLibrary114Library
UP-TO-DATE :app:prepareReleaseDependencies :app:compileReleaseAidl
:app:compileReleaseRenderscript :app:generateReleaseBuildConfig
:app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets
:app:generateReleaseResValues UP-TO-DATE
:app:processReleaseGoogleServices :app:generateReleaseResources
:app:mergeReleaseResources :app:processReleaseManifest
:app:processReleaseResources :app:generateReleaseSources
:app:compileReleaseJavaWithJavac Note: Some input files use or
override a deprecated API. Note: Recompile with -Xlint:deprecation for
details. Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileRetrolambdaRelease :app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources :app:prePackageMarkerForRelease
:app:transformClassesWithRealmTransformerForRelease
:app:processReleaseJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForRelease
:app:transformClassesAndResourcesWithProguardForRelease assmember)
Warning:there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
Warning:Exception while processing task java.io.IOException: Please
correct the above warnings first.
:app:transformClassesAndResourcesWithProguardForRelease FAILED
Error:Execution failed for task
':app:transformClassesAndResourcesWithProguardForRelease'.
java.io.IOException: Please correct the above warnings first. Information:BUILD FAILED Information:Total time: 27.946 secs
Information:1 error Information:91 warnings Information:See complete
output in console
If you enable minifying, the build will call Proguard to strip out every unnecessary classes, members and methods.
For this to work, you'll need a proguard config file, which will tell Proguard which classes are your entrypoint to your classes and which members and methods should be kept.
The error you are seeing is a common error for mismatching method calls.
The error includes a link to the Proguard manual, describing the error a bit more: you'll have to make sure that you are using the right Android Build Target and that you keep all necessary libs and their methods.
Try to adapt the Android Build Target in your properties. If this doesn't work, you'll have to check if you need more entries in your proguard config.

Android studio: Gradle build finished with error

I have been using Android Studio and I am getting this error when trying to build.I can't able to proceed.
This is the error in Android Studio:
Executing tasks: [:libraries:facebook:generateDebugSources, :library:generateDebugSources, :volley:generateDebugSources]
Configuration on demand is an incubating feature.
WARNING [Project: :volley] "testPackageName" is deprecated (and will soon stop working); change to "testApplicationId" instead
:libraries:facebook:preBuild
:libraries:facebook:preDebugBuild
:libraries:facebook:checkDebugManifest
:libraries:facebook:prepareDebugDependencies
:libraries:facebook:compileDebugAidl UP-TO-DATE
:libraries:facebook:compileDebugRenderscript UP-TO-DATE
:libraries:facebook:generateDebugBuildConfig UP-TO-DATE
:libraries:facebook:generateDebugAssets UP-TO-DATE
:libraries:facebook:mergeDebugAssets UP-TO-DATE
:libraries:facebook:generateDebugResValues UP-TO-DATE
:libraries:facebook:generateDebugResources UP-TO-DATE
:libraries:facebook:packageDebugResources UP-TO-DATE
:libraries:facebook:processDebugManifest UP-TO-DATE
:libraries:facebook:processDebugResources UP-TO-DATE
:libraries:facebook:generateDebugSources UP-TO-DATE
:library:preBuild
:library:preDebugBuild
:library:checkDebugManifest
:library:prepareDebugDependencies
:library:compileDebugAidl UP-TO-DATE
:library:compileDebugRenderscript UP-TO-DATE
:library:generateDebugBuildConfig UP-TO-DATE
:library:generateDebugAssets UP-TO-DATE
:library:mergeDebugAssets UP-TO-DATE
:library:generateDebugResValues UP-TO-DATE
:library:generateDebugResources UP-TO-DATE
:library:packageDebugResources UP-TO-DATE
:library:processDebugManifest UP-TO-DATE
:library:processDebugResources UP-TO-DATE
:library:generateDebugSources UP-TO-DATE
:volley:preBuild
:volley:preDebugBuild
:volley:checkDebugManifest
:volley:prepareDebugDependencies
:volley:compileDebugAidl UP-TO-DATE
:volley:compileDebugRenderscript UP-TO-DATE
:volley:generateDebugBuildConfig UP-TO-DATE
:volley:generateDebugAssets UP-TO-DATE
:volley:mergeDebugAssets UP-TO-DATE
:volley:generateDebugResValues UP-TO-DATE
:volley:generateDebugResources UP-TO-DATE
:volley:packageDebugResources UP-TO-DATE
:volley:processDebugManifest UP-TO-DATE
:volley:processDebugResources UP-TO-DATE
:volley:generateDebugSources UP-TO-DATE
BUILD FAILED
Total time: 2 mins 7.494 secs
This is my app gradle :
build.gradle :
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
signingConfigs {
release {
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/ASL2.0'
}
productFlavors {
}
}
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:5.0.77'
compile 'com.android.support:appcompat-v7:+'
compile 'com.makeramen:roundedimageview:1.2.4'
compile 'com.nineoldandroids:library:2.4.0+'
compile project(':libraries:facebook')
compile project(':library')
compile project(':stripe')
compile project(':volley')
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/activation.jar')
compile files('libs/mail.jar')
compile files('libs/iprint.jar')
}
This Question is old but it may be useful for new programmers of Android Studio ,
So this error in my case solved by cleaning project from Build Menu.
I'm not sure if you post all error's text, in my case in the end will be very useful information to fix this trouble. Maybe in your case trouble is the same.
So, in my case was trouble with dependecies.
In my app module in build.grale I used other dependencies for support.v4
In your case: compile 'com.android.support:support-v4:19.1.0'
Facebook SDK used jar, so, support.v4 was added as jar.
To fix this, just remove jar, and add to your Facebook build.gradle file the same line to import support library as on your main app module.
Hope, this will help you.
I faced same issue today
This is a bug in dex merger when the dex files that are being merged have more than 65536 methods (or strings). We can fix this by adding
dexOptions {
jumboMode = true
}
In the gradle file. Don’t forget to add this all sub projects too else it may not work.
I faced this problem in ubuntu 16.04 and came up with a simple solution:
Type sudo nautilus in terminal.
Now go to the root directory and recursively change permissions to Read and Write and Create and Delete files. You will be able to do that by the option Change permissions for enclosed files.

Categories

Resources