Android Studio 2.0 Gradle Bug - android

I wasn't sure what to name the question so bear with me.
I work on two machines, my PC and my Mac. Currently I have upgraded to Android Studio 2.0 on my PC to get all the new features and it is a mess. I need help.
So what is happening is that when I try to run the app the gradle build fails. It fails with this message :
Executing tasks: [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2320Library
:app:prepareComAndroidSupportAppcompatV72320Library
:app:prepareComAndroidSupportDesign2320Library
:app:prepareComAndroidSupportRecyclerviewV72320Library
:app:prepareComAndroidSupportSupportV42320Library
:app:prepareComAndroidSupportSupportVectorDrawable2320Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:compileDebugJavaWithJavac
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/BCKEY.SF
File1: C:\Users\Andy\.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcpkix-jdk15on\1.51\6c8c1f61bf27a09f9b1a8abc201523669bba9597\bcpkix-jdk15on-1.51.jar
File2: C:\Users\Andy\.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.51\9ab8afcc2842d5ef06eb775a0a2b12783b99aa80\bcprov-jdk15on-1.51.jar
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: 15.114 secs
Here is a list of my dependencies
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.code.gson:gson:2.5'
compile 'com.hierynomus:sshj:0.15.0'
compile 'joda-time:joda-time:2.9.1'
compile 'de.greenrobot:eventbus:2.4.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:design:23.2.0'
}
Now the odd thing is that if I run the exact same source code on my mac its fine. So what is going on? Is this a bug with v2.0, it seems unlikely though.
If you need any more info let me know!
Thanks
Andy

Hey so with some help I figued out that com.hierynomous:sshj was also wanting Bouncy Castle and therefor conflicting with the caked in Android one.
Hope this helps someone in the future.

Related

DuplicateFileException error while building Android APK

I am using Android Studio 2.0 on Windows 7. When building my Android project, I get the following error:
:app:transformResourcesWithMergeJavaResForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanish.txt
File1: C:\Users\USER\.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine-api-1.0-sdk\1.9.28\e92c18272b555027d9ec666e7a89162f10638314\appengine-api-1.0-sdk-1.9.28.jar
File2: C:\Users\USER\.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine-endpoints\1.9.28\bf2e8a74bd28e388b3487fc78a0c7adfa592fd5d\appengine-endpoints-1.9.28.jar`
I have been digging around for hours and can't see anything that causes this. I've deleted .gradle in my home directory, but it just rebuilds it all the same. Does anyone know what causes this?
Full gradle output:
Executing tasks: [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]
Configuration on demand is an incubating feature.
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Incremental java compilation is an incubating feature.
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:backend:appengineDownloadSdk
:backend:compileJava
:backend:processResources UP-TO-DATE
:backend:classes
:backend:appengineEndpointsGetClientLibs UP-TO-DATE
:backend:appengineEndpointsExpandClientLibs UP-TO-DATE
:backend:compileEndpointsSrcJava
:backend:processEndpointsSrcResources UP-TO-DATE
:backend:endpointsSrcClasses
:backend:_appengineEndpointsAndroidArtifact UP-TO-DATE
:backend:jar UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2330Library
:app:prepareComAndroidSupportAppcompatV72330Library
:app:prepareComAndroidSupportSupportV42330Library
:app:prepareComAndroidSupportSupportVectorDrawable2330Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:compileDebugJavaWithJavac
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanish.txt
File1: C:\Users\USER\.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine-api-1.0-sdk\1.9.28\e92c18272b555027d9ec666e7a89162f10638314\appengine-api-1.0-sdk-1.9.28.jar
File2: C:\Users\USER\.gradle\caches\modules-2\files-2.1\com.google.appengine\appengine-endpoints\1.9.28\bf2e8a74bd28e388b3487fc78a0c7adfa592fd5d\appengine-endpoints-1.9.28.jar
* 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: 15.364 secs
From what I can tell, it's a conflict between two dependencies:
dependencies {
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.28'
compile 'com.google.appengine:appengine-endpoints:1.9.28'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.28'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.google.http-client:google-http-client-jackson2:1.20.0'
compile 'com.google.http-client:google-http-client-gson:1.19.0'
}
I think it's these two dependencies:
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.28'
compile 'com.google.appengine:appengine-endpoints:1.9.28'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.28'
I'm not able to remove any of these, as it causes compile errors on the backend module. It looks like those two dependencies are almost identical, however. Should they both be in there? Any advice is appreciated!
To complete #dsh's answer:
In your dependency tree there are 2 jar files containing the same file named sep_approx_spanish.txt , this is not allowed.
To resolve your problem you have to track down which of your gradle dependencies has the two jars named appengine-api-1.0-sdk-1.9.28.jar and appengine-endpoints-1.9.28.jar; to do this you can open android studio's terminal console and type in:
//if ou are on windows
gradlew dependencies
//if you are on unix based os
./gradlew dependencies
You will see gradle doing a lot of things, but at a certain point it will print the entire dependency tree. Once you find which are the 2 dependencies are causing the problem, add this piece of code at the end of one of the dependency declarations
{
exclude "sep_approx_spanish.txt"
}
So for example if the two dependencies are these
compile 'com.google.appengine:appengine-endpoints:1.9.28'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.28
if must become
compile 'com.google.appengine:appengine-endpoints:1.9.28'{
exclude "sep_approx_spanish.txt"
}
compile 'com.google.appengine:appengine-endpoints-deps:1.9.28
or
compile 'com.google.appengine:appengine-endpoints:1.9.28'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.28'{
exclude "sep_approx_spanish.txt"
}
in this way you tell to gradle to not take into consideration that file for one of the two libraries, avoiding the file's duplication inside the apk.
The error tells you that building your APK would result in two files named com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep_approx_spanish.txt. This is a failure because the APK can only contain one file at any given path. This is probably caused by two different jar files in your classpath that contain the file. In my project, this only occurred with files that were not actually used at runtime so I excluded them from the APK entirely.
Completing #Apperside answer.
I fixed the error by adding the following lines to my build.gradle file of my app module:
android{
packagingOptions {
exclude 'com/google/appengine/repackaged/org/apache/commons/codec/language/bm/*'
exclude 'com/google/appengine/repackaged/org/codehaus/jackson/impl/VERSION.txt'
exclude 'com/google/appengine/repackaged/org/apache/commons/codec/language/*'
}
(...)
}

Android studio gradle exception ( sdk 23.2.0, retrofit 2, google-service 8.4)

During building my project, I'm getting a gradle build error:
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
1 error; aborting
Why this is happening?
Full log is below
My gradle is:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.okhttp3:okhttp:3.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.appbrain:appbrain-applift-sdk:10.51'
compile 'com.android.support:multidex:1.0.1'
}
return this exception:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2320Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72320Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72320Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2320Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42320Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2320Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk410Library UP-TO-DATE
:app:prepareComGithubNirhartParallaxscroll10Library 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:prepareDeHdodenhofCircleimageview130Library 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:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:transformClassesWithMultidexlistForDebug UP-TO-DATE
:app:transformClassesWithDexForDebug
Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
1 error; aborting
Error:Execution failed for task ':tbkha:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 2 mins 39.656 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
How I can solve this problem?
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Execution failed for task ':tbkha:transformClassesWithDexForDebug'.
It looks like this happened because of gradle running low on memory while converting the java code to dex.
You can increase the memory allocated to gradle by changing 'gradle-wrapper.properties' (which is usually at /{project_name}/gradle/wrapper/gradle-wrapper.properties ).
All you need to do is, add following lines to it
org.gradle.jvmargs=-Xmx1024m
EDIT
You can also improve javaMaxHeapSize in build build.gradle
android {
dexOptions {
javaMaxHeapSize = "4g"
}
}

android application not compiling

I get the following error when I try to run the project in Android studio.I have recently added Butterknife dependency in gradle.After adding I get the following error.Please help me!!!I have included the error and the gradle file below.
Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.jobinsabu.destination"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
// ...
maven {url "https://jitpack.io"}
maven {url 'http://yanzm.github.io/MaterialTabHost/repository'}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.prolificinteractive:material-calendarview:1.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.flaviofaria:kenburnsview:1.0.7'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.github.jd-alexander:library:1.1.0'
compile 'se.walkercrou:google-places-api-java:2.1.2'
compile 'com.github.ganfra:material-spinner:1.1.1'
compile 'io.nlopez.smartlocation:library:3.2.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile ('com.github.ozodrukh:CircularReveal:1.3.1#aar') {
transitive = true;
}
compile 'com.ogaclejapan.smarttablayout:library:1.6.0#aar'
compile ('com.github.florent37:materialviewpager:1.1.3#aar'){
transitive = true
}
compile 'com.rengwuxian.materialedittext:library:2.1.4'
}
Error:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug]
Warning:Dependency org.json:json:20140107 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.3.5 is ignored for debug as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.json:json:20140107 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.3.5 is ignored for release as it may be conflicting with the internal version provided by Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72300Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComGithubFlorent37Materialviewpager113Library UP-TO-DATE
:app:prepareComGithubGanfraMaterialSpinner111Library UP-TO-DATE
:app:prepareComGithubJdAlexanderLibrary110Library UP-TO-DATE
:app:prepareComGithubKsoichiroAndroidObservablescrollview152Library UP-TO-DATE
:app:prepareComGithubOzodrukhCircularReveal131Library 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:prepareComJpardogoMaterialtabstripLibrary110Library UP-TO-DATE
:app:prepareComMiguelcatalanMaterialsearchview140Library UP-TO-DATE
:app:prepareComOgaclejapanSmarttablayoutLibrary160Library UP-TO-DATE
:app:prepareComProlificinteractiveMaterialCalendarview120Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:app:prepareIoNlopezSmartlocationLibrary321Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac
Note: E:\Destination\app\src\main\java\com\example\jobinsabu\destination\MainActivity.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:preDexDebug UP-TO-DATE
:app:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:161)
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_66\bin\java.exe'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 6.905 secs
Information:1 error
Information:4 warnings
Information:See complete output in console

how to add selenium to android project

hi im trying to add selenium to my android studio app but i keep getting error
Caused by: java.lang.VerifyError: org.openqa.selenium.htmlunit.HtmlUnitDriver
i have selenium added to project structor and my grade dependencies are
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.0'
compile files('libs/selenium-java-2.47.1-srcs.jar')
compile files('libs/selenium-java-2.47.1.jar')
compile files('libs/htmlunit-2.17.jar')
compile files('libs/htmlunit-core-js-2.17.jar')
}
i have tryed adding all jars from selenium lib folder but this causes the gradle build time to be approx ten min and then it just crashes anyone have any ideas on how to add selenium I norm use netbeans where you can just create a library and dump a folder of jars in so i might just be doing something really stupid
when all dependencies are added this is the error i get
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library 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:collectDebugMultiDexComponents
:app:packageAllDebugClassesForMultiDex
:app:shrinkDebugMultiDexComponents
:app:createDebugMainDexClassList FAILED
Error:Execution failed for task ':app:createDebugMainDexClassList'.
> 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: 21.207 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
a! the min sdk version for multiDex must be greater than 14 so in gradle build
minSdkVersion 14

gradle build is successful but ":app:compileDebugJava FAILED" while running

I am trying to debug my app.
when i click "sync project with gradle files", build is successful but when i try to run gradle console shows ":app:compileDebugJava FAILED" occurs.
this is my success build from gradle console.
Executing tasks: [:app:generateDebugSources,:app:generateDebugAndroidTestSources]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest UP-TO-DATE
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources UP-TO-DATE
:app:generateDebugAndroidTestSources UP-TO-DATE
BUILD SUCCESSFUL
Total time: 2.204 secs
and gradle console with error is as:
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> java.lang.NullPointerException
* 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: 2.161 secs
Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
lintOptions {
disable 'InvalidPackage'
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.+'
compile 'io.reactivex:rxjava:1.0.+'
compile 'io.reactivex:rxandroid:0.23.+'
compile 'com.squareup.retrofit:retrofit:1.8.+'
compile 'com.squareup.okio:okio:1.1.+'
compile 'com.andrewreitz:shillelagh:0.5.0'
provided 'com.andrewreitz:shillelagh-processor:0.5.0'
compile 'com.squareup.okhttp:okhttp:2.1.+'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.+'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5#jar'
}
I have done this issue, I'm using JDK6, but project built at JDK7, so I installed JDK7 and set path and java_home and run again, It's working fine....
View this link.

Categories

Resources