I'm adding in a few libraries from Apache POI I had overcome several problems, but am now stuck on this error message when i'm trying to run the app;
> Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2221Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:prepareComBignerdranchAndroidExpandablerecyclerview103Library UP-TO-DATE
:app:prepareComGithubTraexExpandablelayoutLibrary13Library 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 UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug
trouble processing "javax/xml/stream/events/StartElement.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
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.8.0_77\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 23.816 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Things I've tried:
Using Enabling Multidex with javaMaxHeapSize
Different versions of my required libraries
Clean/Build 9000+ times
Using the .java files (from apache site) and adding them to the dependencies
Disabling proguard (for some reason)
Going back and configuring JAVA_HOME + path
Updating java (which ill try revert back to 1.7 tomorrow)
and probably some other stuff.
Here is my build.gradle file without the error
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
}
defaultConfig {
applicationId "com.example.justin.wordcreator"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['Parse-*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:recyclerview-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.bignerdranch.android:expandablerecyclerview:1.0.3'
compile 'com.github.traex.expandablelayout:library:1.3'
compile 'org.apache.poi:poi-scratchpad:3.14'
compile 'com.github.virtuald:curvesapi:1.03'
compile 'org.apache.poi:poi:3.14'
compile 'xmlbeans:xmlbeans:2.3.0'
}
If narrowed it down to these three libraries (Im using xmlbeans 2.3, but would like to get 2.6 working)
compile 'org.apache.xmlbeans:xmlbeans:2.6.0'
compile 'org.apache.poi:poi-ooxml:3.14'
compile 'org.apache.poi:poi-ooxml-schemas:3.14'
once i add any or all of them I get that error message.
There are some things that break when using bare POI on Android, e.g. the XMLBeans jar file has forbidden and duplicated classes which causes Android compilation to fail.
Take a look at https://github.com/andruhon/android5xlsx which provides adjusted jar-files that seem to make using Apache POI on Android 5.x possible.
Related
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
GRADLE CONSOLE OUTPUT:
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
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:prepareComAndroidSupportAnimatedVectorDrawable2510Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72510Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42510Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2510Library UP-TO-DATE
:app:prepareComAndroidVolleyVolley100Library 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:generateDebugResources UP-TO-DATE
: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
Can anyone help me in fixing this. I am new to android :(
I have added a screen shot of Android Manifest.
So far I have tried below steps to fix the issue. Still no help.
1) Clean Prjoect
2) Rebuild Project
3) File > Invalid Cache/Restart
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.theaquarious.myfavapp"
minSdkVersion 14
targetSdkVersion 25
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'
}
}
}
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:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.mcxiaoke.volley:library:1.0.19'
}
This issue is now resolved. The error was raised due to the image file. I have changed the extension of an JPG image to PNG without using any editor. Due to this android studio started to throw the error. Thanks to everyone who tried to help me. If anyone needs more clarification on this, just comment.
This appears to be a bug in aquiring a lock in some Java thread. I see this on my Windows 7 PC starting recently. I have had success by simply running Task Manager and then killing the java.exe process. If I then try again, the build seems to work fine.
The error is because the names of the files that are saved in your Drawable folder can not be capitalized. Rename the file and leave everything in lowercase.
Don’t save drawable images in capital case and it should be png not jpg else it will throw an error : Execution failed for task ':app:mergeDebugResources'
When I tried to add poi-ooxml in app/build.gradle file then this error is coming
"Execution failed' :app:transformClassesWithDexForDebug'.com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'java'' finished with non-zero exit value 1"
app/build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "applicationID"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile files('libs/jxl.jar')
compile group: 'org.apache.poi', name: 'poi', version: '3.9'
compile group: 'org.apache.poi', name: 'poi-ooxml', version: '3.9'
}
Logcat
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library 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 UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug
trouble processing "javax/xml/XMLConstants.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
1 error; aborting
**Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> 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 1**
Information:BUILD FAILED
Information:Total time: 59.141 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Apache POI will not work out of the box on Android due to various problems that you will run into when using bare Apache POI.
There are some projects that make it possible to use parts of Apache POI on Android:
https://github.com/andruhon/android5xlsx (for Android 5) and https://github.com/andruhon/AndroidReadXLSX (for Android 4), both are currently still based on Apache POI 3.12
https://github.com/centic9/poi-on-android/ (for Android 5, maintained by me), which can be more easily recompiled with newer versions of POI, e.g. it uses 3.15 currently
I faced this problem before, try to add a deafultConfig
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
I am using Comriva library to extract MFCC features to my speech recognition project. And i have imported the comriva core packages to my project. When i tired to build it im getting this error in gradle,
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:packageAllDebugClassesForMultiDex UP-TO-DATE
:app:shrinkDebugMultiDexComponents UP-TO-DATE
:app:createDebugMainDexClassList UP-TO-DATE
:app:dexDebug
trouble processing "javax/xml/stream/events/StartElement.class":
Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.
1 error; aborting
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 5.524 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
I didn't include any xml libraries so far like simple-xml.
This is my gradle.build file,
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "info.androidhive.sleepApp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile files('libs/jl1.0.jar')
compile files('libs/commons-logging-api.jar')
compile files('libs/cp.jar')
compile files('libs/http-2.2.1.jar')
compile files('libs/jama-1.0.2.jar')
compile files('libs/jl1.0.jar')
compile files('libs/jogg-0.0.7.jar')
compile files('libs/lucene-analyzers-3.0.0.jar')
compile files('libs/lucene-core-3.0.0.jar')
compile files('libs/lucene-queries-3.0.0.jar')
compile files('libs/lucene-queryparser-3.0.0.jar')
compile files('libs/lucene-snowball-3.0.3.jar')
compile files('libs/jorbis-0.0.15.jar')
compile files('libs/mdsj.jar')
compile files('libs/tritonus_remaining.jar')
compile files('libs/tritonus_share.jar')
compile files('libs/wstx-lgpl-3.0.1.jar')
compile files('libs/weka-stable-3.6.13.jar')
compile files('libs/stax-api-1.0.jar')
compile files('libs/mp3spi1.9.4.jar')
}
Please help me to overcome this problem.
Libraries you haven't explicitly included, can sometimes be brought into your build transitively - as in, a library you did add, depends on another library.
You can run gradle dependencies to show a tree of dependencies to analyze which dependency pulls in which transitive dependencies.
I figured out the issue it was the stax-api-1.0.jar this included the javax.xml.stream.events.* classes after removing the jar i was able to build it successfully. This jar came with the comriva that is why i didn't notice it.
I have faced a unknown type of error.
here my build.grable:-
apply plugin: 'com.android.application'
repositories {
maven { url "https://jitpack.io" }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "shoppingmazza.android.catalyst.com.shoppingmazza"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile files('libs/fluent-hc-4.5.jar')
compile files('libs/httpclient-4.5.jar')
compile files('libs/httpclient-cache-4.5.jar')
compile files('libs/httpclient-win-4.5.jar')
compile files('libs/httpcore-4.4.1.jar')
compile files('libs/httpmime-4.5.jar')
compile files('libs/jna-4.1.0.jar')
compile files('libs/jna-platform-4.1.0.jar')
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile files('libs/commons-net-3.0.1.jar')
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar'
}
and here my logcat:-
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:app:prepareComDaimajiaSliderLibrary115Library UP-TO-DATE
:app:prepareComGithubJakeWhartonViewPagerIndicator241Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 2
I am new in android developing.Anyone can help me solved my problem. I near my to complete project. Please help me. Thanks in advance!
Add this inside your android block:
dexOptions {
preDexLibraries = false
}
Your project methods is over 65k. You should implement Multidex
if your project has more than 65K method , you have to enable multiDex option in gradle ,, to make sure if the problem caused by multiDex ,, just run your app on a lolipop device if it running fine , then the problem is MultiDex ,
lolipop doesn't use Dalvik thats why it will running fine
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
You are adding twice the support-library v4.
It happens because you are using
compile 'com.github.JakeWharton:ViewPagerIndicator:2.4.1#aar'
You are getting this library from the jitpack.
This library adds the support library as a jar and not as a gradle dependency.
It means that the pom file doesn't have a dependency and you can't exclude the jar file with gradle because the jar is inside the aar file (without a pom how can gradle know that these files should be excluded?).
You can check the files in the jitpack repo:
pom file
aar file
You can try to use the same library from other repo, for example:
`fr.avianey.com.viewpagerindicator:library:2.4.1`
You can check this issue on github.
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.