When I run Build - rebuild project I get the following error
I have tryed many sollution but nothing works..
What went wrong:
the error build code:
Executing tasks: [:app:generateDebugSources]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
AGPBI: {"kind":"error","text":"error: resource drawable/appiconlarge () not found.","sources":[{"file":"/home/.gradle/caches/transforms-1/files-1.1/appcompat-v7-25.3.1.aar/a9a8f29f5baeae5b590388a64347d1e6/res/values/values.xml","position":{"startLine":1362,"startColumn":4,"startOffset":99385,"endLine":1403,"endColumn":12,"endOffset":102566}}],"original":"","tool":"AAPT"}
:app:processDebugResources
error: failed linking references.
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to process resources, see aapt output above for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "xxxx"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner
manifestPlaceholders = [auth0Domain:"#string/com_auth0_domain"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.google.android.gms:play-services-maps:10.0.0'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.auth0.android:lock:2.7.0'
implementation 'com.android.support:cardview-v7:25.3.1'
implementation 'com.android.support:support-annotations:24.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
}
The main issue is
resource drawable/appiconlarge not found
Please check the drawable/appiconlarge file exists or not. If not please add appiconlarge image on the drawable directory.
Hope this will solve your problem.
Consider doing this, not sure it would remove the error but it helped in my case.
android.enableAapt2=true
Related
I am new To android studio. I have made a Java project which mainly works with an SQLite db (in assets folder). I migrated This project to android studio from netbeans. When I press run and choose an emulator, Gradle Build Tasks start to execute and an error occurs which says:
Error:Execution failed for task
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException:
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
The Complete error output in console says:
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 39s
This is the Stack trace after pressing 'run'
Executing tasks: [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:transformClassesWithDexBuilderForDebug UP-TO-DATE
:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
There are a lot of solution on the web like putmultiDexEnabled true in gradle.build file which I already had.
Update This is my gradle.build file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.bcosta.myapplication"
minSdkVersion 23
targetSdkVersion 23
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 {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
This seems like a common problem with no definitive solution.
Try:
Delete the .gradle directory.
Clean project and build again.
If that doesn't work, try adding the following to your build.gradle:
android {
dexOptions{
jumboMode=true;
javaMaxHeapSize "4g"
}
}
Also, try File -> Invalidate Caches/Restart
Try this,
android {
defaultConfig {
...
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
If you don’t have a custom Application class, then add this line to manifest
<application
android:name="android.support.multidex.MultiDexApplication"
.....your code
If you already have your own Application class, make it extend android.support.multidex.MultiDexApplication instead of android.app.Application
import android.support.multidex.MultiDexApplication;
public class MyApplication extends MultiDexApplication {
/* To enable Multi-Dex, you have 3 options -
1. Declare android.support.multidex.MultiDexApplication as your application class in AndroidManifest.xml
2. Extend MultiDexApplication like we are doing here
3. Override attachBaseContext() in your application class as shown below
/*
*/
/*
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
*/
}
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'
I am getting this error from build-tools\23.0.2\ (Aapt.exe)
finished with non zero exit value 1.
I am using Android Studio Version 1.4.1
I am using the API level 23 with the updated build tools, and my log cat is often meaning out the string.xml where I created my strings to refer it for the list view.
Executing tasks: [:app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:compileDebugSources,
:app:compileDebugAndroidTestSources, :mylibrary:generateDebugSources,
:mylibrary:generateDebugAndroidTestSources,
:mylibrary:compileDebugSources,
:mylibrary:compileDebugAndroidTestSources]
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:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library 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 AGPBI: { "kind":"error","text":"Apostrophe
not preceded by \ ( in ithin the lifecycle callback methods, you can
declare how your activity behaves when the user leaves and re-enters
the activity. For example, if you\u0027re building a streaming video
player, you might pause the video and terminate the network connection
when the user switches to another app. When the user returns, you can
reconnect to the network and allow the user to resume the video from
the same spot. )", "sources":[
{"file":"C:\Users\PreciseT3\AndroidStudioProjects\ListviewApp1\app\src\main\res\values\strings.xml","position":
{ "startLine":1}}],"original":""}
FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command
'C:\Users\PreciseT3\AppData\Local\Android\sdk\build-tools\23.0.2\aapt.exe''
finished with non-zero exit value 1
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: 12.649 secs
Problem is in your string.xml
find all occurrences of single-quote (') or apostrophe and add a back-slash escape character (\) before each occurrence.
XML cannot deal with (')
Basically, replace all ' with \'
Compare your gradle file I hope this work
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "info.tranetech.laundry"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:design:23.0.1'
compile 'com.squareup.picasso:picasso:+'
testCompile 'junit:junit:4.12'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile files('libs/android-async-http-1.4.4.jar')
compile 'com.google.android.gms:play-services:8.4.0'
}
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.
When I try to debug my app in Android Studio I get a gradle error. I have now idea how I can fix it. Does anyone have any ideas or fixes for me so I can continue debugging my app. I googled it already and people are saying the cause could be that there are duplicate imports in the gradle file but I checked this and there are none. When I rebuilt gradle it is successful but when I debug I get this error.
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2220Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72100Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:prepareComBalysvMaterialmenuMaterialMenu154Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:app:prepareComGithubJohnkilAndroidRobototextviewRobototextview240Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug UP-TO-DATE
:app:dexDebug
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:502)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/x/Development/Android SDK/build-tools/21.1.2/dx --dex --no-optimize --output /Users/app/app/build/intermediates/dex/debug --input-list=/Users/app/app/build/intermediates/tmp/dex/debug/inputList.txt
Error Code:
2
Output:
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:502)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:277)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
* 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: 42.045 secs
My build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.3.2'
def JacksonVersion = '2.5.2'
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
// androidManifestFile variant.outputs[0].processResources.manifestFile
// if you have multiple outputs (when using splits), you may want to have other index than 0
// you should set your package name here if you are using different application IDs
resourcePackageName "com.app"
// You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.app"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/spring.handlers'
exclude 'META-INF/spring.schemas'
exclude 'META-INF/spring.tooling'
}
}
repositories {
mavenCentral()
mavenLocal()
maven {
url 'http://repo.spring.io/milestone'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:design:22.2.0'
compile(
[group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "$JacksonVersion"],
[group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "$JacksonVersion"],
[group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "$JacksonVersion"]
)
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile "org.springframework.android:spring-android-rest-template:2.0.0.M2"
compile "com.squareup.okhttp:okhttp:2.4.0"
compile "com.squareup.okhttp:okhttp-urlconnection:2.4.0"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
compile 'com.github.johnkil.android-robototextview:robototextview:2.4.0'
compile 'com.balysv.materialmenu:material-menu:1.5.4'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.google.android.gms:play-services:7.5.0'
}
It means that you reached dex methods count limit, one dex file can contain max 65536. You can try to remove redundant libraries and reduce methods count or implement multidex application and add as many methods as you want.
Here's a great example of multidex implementation with possible workarounds and tricks.
Whats your Logcat Throws
Execution failed for task ':app:dexDebug'.
some of your jar files does not compile. You should go into your build.gradle file in your project, and look in your dependencies.
Just enable multiDexEnabled true
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
See Unable to execute dex: method ID not in [0, 0xffff]: 65536
and
https://developer.android.com/studio/build/multidex.html