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...
Related
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.
I'm working on an Adnroid app that was imported. The imported app used an old version of Gradle so I'm trying to sync it to the new ones (it used Gradle 19 I think). I'm unable to use Gradle 24 b/c there are symbol class finders that can't be found, so I'm just trying to get this working with 21, but it still won't work. Can anyone help?
Here is my outer .build file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
allprojects {
repositories {
mavenCentral()
// maven { url 'http://clinker.47deg.com/nexus/content/groups/public' }
// maven { url 'http://repo1.maven.org/maven2' }
}
}
Here is my inner .build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.0"
defaultConfig {
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
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:support-core-utils:21.0.0"
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'se.emilsjolander:stickylistheaders:2.5.2'
compile 'com.github.chrisbanes.photoview:library:1.2.2'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.google.android.gms:play-services:6.1.71'
}
When I run this on an physical android I get this error:
Executing tasks: [:leafsnap:clean, :leafsnap:generateDebugSources, :leafsnap:generateDebugAndroidTestSources, :leafsnap:mockableAndroidJar, :leafsnap:prepareDebugUnitTestDependencies, :leafsnap:assembleDebug]
Configuration on demand is an incubating feature.
Observed package id 'add-ons;addon-google_apis-google-24' in inconsistent location 'C:\Users\Butters Stotch\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-24-1' (Expected 'C:\Users\Butters Stotch\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-24')
Already observed package id 'add-ons;addon-google_apis-google-24' in 'C:\Users\Butters Stotch\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-24'. Skipping duplicate at 'C:\Users\Butters Stotch\AppData\Local\Android\Sdk\add-ons\addon-google_apis-google-24-1'
Incremental java compilation is an incubating feature.
:leafsnap:clean
:leafsnap:preBuild UP-TO-DATE
:leafsnap:preDebugBuild UP-TO-DATE
:leafsnap:checkDebugManifest
:leafsnap:preReleaseBuild UP-TO-DATE
:leafsnap:prepareComAndroidSupportAppcompatV72100Library
:leafsnap:prepareComAndroidSupportSupportV42100Library
:leafsnap:prepareComGoogleAndroidGmsPlayServices6171Library
:leafsnap:prepareSeEmilsjolanderStickylistheaders252Library
:leafsnap:prepareDebugDependencies
:leafsnap:compileDebugAidl
:leafsnap:compileDebugRenderscript
:leafsnap:generateDebugBuildConfig
:leafsnap:mergeDebugShaders
:leafsnap:compileDebugShaders
:leafsnap:generateDebugAssets
:leafsnap:mergeDebugAssets
:leafsnap:generateDebugResValues UP-TO-DATE
:leafsnap:generateDebugResources
:leafsnap:mergeDebugResources
:leafsnap:processDebugManifest
:leafsnap:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':leafsnap:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Butters Stotch\AppData\Local\Android\Sdk\build-tools\21.0.0\aapt.exe'' finished with non-zero exit value -1073741819
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I can't figure out what's wrong with it. Can anyone help?
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
}
You're using gradle plugin 2.1.3 which according to documentation needs the following as must have dependencies.
Android Plugin for Gradle, Revision 2.1.3 (August 2016)
Dependencies:
Gradle 2.14.1 or higher.
Build Tools 23.0.2 or higher.
This update adds compatibility with Gradle 2.14.1, which includes performance improvements, new features, and an important security fix.
For more details, see the Gradle release notes.
whereas your build tool version currently set as buildToolsVersion "21.0.0".
Change the build tool version to 23.0.2, update the support and appcompat dependencies accordingly and sync again.
I have imported a project from Eclipse into Android Studio 1.0.1 that consists in an Android Library Project (RuletaAfortunadaCore) and an Android Project (RuletaAfortunada), also have some third parties library dependencies. During the import everything seemed fine, but now when I try to build it I get this error message from Gradle:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ruletaAfortunadaCore:proguardRelease'.
> java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options?
The whole output from the start of the building process:
Executing tasks: [clean, :ruletaAfortunada:compileDebugSources, :facebookSDK:compileDebugSources, :ruletaAfortunadaCore:compileDebugSources]
Configuration on demand is an incubating feature.
:facebookSDK:clean
:ruletaAfortunada:clean UP-TO-DATE
:ruletaAfortunadaCore:clean
:facebookSDK:compileLint
:facebookSDK:copyReleaseLint UP-TO-DATE
:facebookSDK:mergeReleaseProguardFiles UP-TO-DATE
:facebookSDK:preBuild
:facebookSDK:preReleaseBuild
:facebookSDK:checkReleaseManifest
:facebookSDK:prepareReleaseDependencies
:facebookSDK:compileReleaseAidl
:facebookSDK:compileReleaseRenderscript
:facebookSDK:generateReleaseBuildConfig
:facebookSDK:generateReleaseAssets UP-TO-DATE
:facebookSDK:mergeReleaseAssets
:facebookSDK:generateReleaseResValues UP-TO-DATE
:facebookSDK:generateReleaseResources
:facebookSDK:packageReleaseResources
:facebookSDK:processReleaseManifest
:facebookSDK:processReleaseResources
:facebookSDK:generateReleaseSources
:facebookSDK:compileReleaseJava
:facebookSDK:processReleaseJavaRes UP-TO-DATE
:facebookSDK:packageReleaseJar
:facebookSDK:compileReleaseNdk
:facebookSDK:packageReleaseJniLibs UP-TO-DATE
:facebookSDK:packageReleaseLocalJar
:facebookSDK:packageReleaseRenderscript UP-TO-DATE
:facebookSDK:bundleRelease
:ruletaAfortunada:preBuild
:ruletaAfortunada:preDebugBuild
:ruletaAfortunada:checkDebugManifest
:ruletaAfortunada:preReleaseBuild
:ruletaAfortunadaCore:compileLint
:ruletaAfortunadaCore:copyReleaseLint UP-TO-DATE
:ruletaAfortunadaCore:preBuild
:ruletaAfortunadaCore:preReleaseBuild
:ruletaAfortunadaCore:checkReleaseManifest
:ruletaAfortunadaCore:preDebugBuild
:ruletaAfortunadaCore:preDebugTestBuild
:ruletaAfortunadaCore:prepareComAndroidSupportSupportV42100Library
:ruletaAfortunadaCore:prepareComGoogleAndroidGmsPlayServices6587Library
:ruletaAfortunadaCore:prepareRuletaAfortunadaFacebookSDKUnspecifiedLibrary
:ruletaAfortunadaCore:prepareReleaseDependencies
:ruletaAfortunadaCore:compileReleaseAidl
:ruletaAfortunadaCore:compileReleaseRenderscript
:ruletaAfortunadaCore:generateReleaseBuildConfig
:ruletaAfortunadaCore:generateReleaseAssets UP-TO-DATE
:ruletaAfortunadaCore:mergeReleaseAssets
:ruletaAfortunadaCore:generateReleaseResValues UP-TO-DATE
:ruletaAfortunadaCore:generateReleaseResources
:ruletaAfortunadaCore:mergeReleaseResources
:ruletaAfortunadaCore:processReleaseManifest
:ruletaAfortunadaCore:processReleaseResources
:ruletaAfortunadaCore:generateReleaseSources
:ruletaAfortunadaCore:compileReleaseJava
:ruletaAfortunadaCore:extractReleaseAnnotations
:ruletaAfortunadaCore:mergeReleaseProguardFiles UP-TO-DATE
:ruletaAfortunadaCore:compileReleaseNdk
:ruletaAfortunadaCore:packageReleaseJniLibs UP-TO-DATE
:ruletaAfortunadaCore:packageReleaseRenderscript UP-TO-DATE
:ruletaAfortunadaCore:packageReleaseResources
:ruletaAfortunadaCore:proguardRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ruletaAfortunadaCore:proguardRelease'.
> java.io.IOException: The output jar is empty. Did you specify the proper '-keep' options?
The contents of the build.gradle file for such library project:
apply plugin: 'com.android.library'
android {
compileSdkVersion 13
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
}
dependencies {
compile project(':facebookSDK')
compile 'com.android.support:support-v4:18.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:+'
compile files('libs/chartboost.jar')
compile files('libs/mint-4.0.7.jar')
}
UPDATE: I have realized that the Android Library Project named RuletaAfortunadaCore can be build as an standalone project or made as a module without problems at all. It only fails to build when building the whole RuletaAfortunada Android Project that uses it.
The build.gradle file for such Android Project is the default one created by Android Studio, I think, so has nothing interesting inside. Anyway, here it is, just in case:
// 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.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
This is the settings.gradle:
include ':facebookSDK'
include ':ruletaAfortunadaCore'
include ':ruletaAfortunada'
And finally, just to have all of them, this is the facebookSDK module build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 9
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 9
targetSdkVersion 9
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:18.0.0'
compile files('libs/bolts-android-1.1.2.jar')
}
As suggested by one guy which answer seem to have vanished now :-?, the solution for me has been to set minifyEnabled to false in the build.gradle of my Library Project. As far as I have it set as true for the Android Project itself, proguard will be executed anyway and the error have disappeared.
I've found some useful info here: http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0
One notable difference is that runProguard was changed to minifyEnabled.
However, after completing the steps from this migration topic, I still run into the same build 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.
I noticed that running gradle assembleRelease calls upon an outdated ProGuard version as can be seen from the shell output:
$ gradle assembleRelease
Relying on packaging to define the extension of the main artifact has been \
deprecated and is scheduled to be removed in Gradle 2.0
:Foobar:preBuild UP-TO-DATE
:Foobar:preReleaseBuild UP-TO-DATE
:Foobar:preDebugBuild UP-TO-DATE
:Foobar:prepareComAndroidSupportAppcompatV71900Library UP-TO-DATE
:Foobar:prepareComGoogleAndroidGmsPlayServices3136Library UP-TO-DATE
:Foobar:prepareReleaseDependencies
:Foobar:compileReleaseAidl UP-TO-DATE
:Foobar:compileReleaseRenderscript UP-TO-DATE
:Foobar:generateReleaseBuildConfig UP-TO-DATE
:Foobar:mergeReleaseAssets UP-TO-DATE
:Foobar:mergeReleaseResources UP-TO-DATE
:Foobar:processReleaseManifest UP-TO-DATE
:Foobar:processReleaseResources UP-TO-DATE
:Foobar:generateReleaseSources UP-TO-DATE
:Foobar:compileRelease UP-TO-DATE
:Foobar:proguardRelease
ProGuard, version 4.9
The output seems up to date
:Foobar:dexRelease UP-TO-DATE
:Foobar:processReleaseJavaRes UP-TO-DATE
:Foobar:packageRelease UP-TO-DATE
:Foobar:assembleRelease UP-TO-DATE
BUILD SUCCESSFUL
Total time: 15.703 secs
I use the following configuration in my build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
runProguard true
proguardFile 'proguard-project.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:19.0.0'
compile 'com.android.support:support-v4:19.0.0'
compile 'com.google.android.gms:play-services:3.1.36'
}
How can I point gradle to a newer version of ProGuard which might be available from the PATH, e.g. /usr/local/bin/proguard?
An alternative solution is to reference the desired version as follows:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
classpath 'net.sf.proguard:proguard-gradle:4.10'
}
}
...
What is your setup?
The official Proguard doc shows how you can point to proguard in the build.gradle. See here
As per the Proguard manual you can do the below to point to a proguard binary,
buildscript {
repositories {
flatDir dirs: '/usr/local/java/proguard/lib'
}
dependencies {
classpath ':proguard'
}
}
I think this might cause problems with the proguard version that comes shipped with the android SDK. Not tried yet!!