The number of method references in a .dex file cannot exceed 64k API 17

You have too many methods. There can only be 65536 methods for dex. As suggested you can use the multidex support. Just add these lines in the module/build.gradle: android { defaultConfig { … // Enabling multidex support. multiDexEnabled true } … } dependencies { implementation ‘androidx.multidex:multidex:2.0.1’ //with androidx libraries //implementation ‘com.android.support:multidex:1.0.3’ //with support libraries } … Read more

Android studio 3.0: Unable to resolve dependency for :app@dexOptions/compileClasspath’: Could not resolve project :animators

With Android Studio 2.3(AS) the project works fine and i can able to run the App. After updating the AS to Android Studio 3.0. i too got the error as below for libraries and build types. Unable to resolve dependency for ‘:app@dexOptions/compileClasspath’: Could not resolve project : library_Name. Unable to resolve dependency for ‘:app@release/compileClasspath’: Could … Read more

android studio 0.4.2: Gradle project sync failed error

I’m assuming I can answer my own question…. This worked for me. File -> Invalidate caches / Restart Shutdown Android Studio Rename/remove .gradle folder in the user home directory Restart Android Studio let it download all the Gradle stuff it needs Gradle build success ! Rebuild project…. success ! Out of curiousity I compared the … Read more

How to disable gradle ‘offline mode’ in android studio? [duplicate]

New location in Android Studio 3.6+ View > Tool Windows > Gradle from the menu bar. Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel. Old answer On Windows:- Go to File -> Settings. And open the ‘Build,Execution,Deployment’. Then open the Build Tools -> Gradle … Read more

Adding local .aar files to Gradle build using “flatDirs” is not working

Building upon Josiah’s answer, here’s how I got it to work. Following his instructions (under edit) (File -> New-> New Module -> Import .JAR/.AAR) and import your .AAR. Then in your project build.gradle (not the top level one, the one under ‘app’) add the following (in the dependencies section): dependencies { compile project(‘:Name-Of-Your-Project’) } Note … Read more

finished with non zero exit value

I was getting this exact same error. I ran the command ./gradlew assembleDebug –info Where “assembleDebug” was replaced with the assemble task for a debug version of the flavor I wanted. Look for output Successfully started process ‘command ‘/usr/local/opt/android-sdk/build-tools/21.1.2/aapt” Right below that was an error describing a resource which I used in a layout file … Read more

Android Material and appcompat Manifest merger failed

I had similar problem. Added two lines in gradle.properties file: android.useAndroidX=true android.enableJetifier=true These two lines automatically resolved my dependency conflicts between google’s files and third party dependencies. Here’s the link to follow: https://developer.android.com/topic/libraries/support-library/androidx-overview#new-project

Failed to resolve: com.android.support:appcompat-v7:26.0.0

To use support libraries starting from version 26.0.0 you need to add Google’s Maven repository to your project’s build.gradle file as described here: https://developer.android.com/topic/libraries/support-library/setup.html allprojects { repositories { jcenter() maven { url “https://maven.google.com” } } } For Android Studio 3.0.0 and above: allprojects { repositories { jcenter() google() } }