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

Error “File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it” [duplicate]

You need to get the configuration file from the developer’s site and paste it in the app level directory of your project. Update: Goto https://console.firebase.google.com/ Select your project On the left menu, click on settings > project settings Add an app or download the google-services.json file under the Your Apps section.

Android Studio 0.4 Duplicate files copied in APK META-INF/LICENSE.txt

Putting the dependecies at the top and the packageOptions at the end worked for me. apply plugin: ‘android’. Here is my full build.gradle at the app folder. dependencies { compile ‘com.android.support:support-v4:+’ compile files(‘libs/apache-mime4j-0.6.jar’) compile files(‘libs/httpmime-4.0.jar’) } android { compileSdkVersion 19 buildToolsVersion “19.0.1” defaultConfig { minSdkVersion 7 targetSdkVersion 10 versionCode 1 versionName “1.0” } buildTypes { … Read more

Error:(6, 0) Gradle DSL method not found: ‘google()’

The google() repo is a shortcut to look in Google’s Maven repository for dependencies. It was introduced with gradle v.4.0. It requires (currently) Gradle v.4 Android Studio 3.x. Gradle plugin for Android 3.x Try to use in gradle-wrapper.properties use: distributionUrl=\ https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip As gradle plugin for Android use: classpath ‘com.android.tools.build:gradle:3.0.0-beta1’ In any case (also with Android … Read more

How do I show dependencies tree in Android Studio?

The image in the question doesn’t really show a tree, just a flat list of everything compiled into the app. Are you using Gradle? If so, you can truly see the “tree” by running a Gradle command Android documentation: View the dependency tree GUI Select View > Tool Windows > Gradle (or click Gradle icon … Read more

“Gradle Version 2.10 is required.” Error

You need to change File > Settings > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home path On Mac OS, change the path in Android Studio > Preferences > Builds,Execution,Deployment > Build Tools > Gradle >Gradle home Or set Use default gradle wrapper and edit Project\gradle\wrapper\gradle-wrapper.properties files field distributionUrl like this distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

Error:Execution failed for task ‘:android:transformClassesAndResourcesWithProguardForRelease’

This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn’t match (in terms of compatibility). The solution is to verify if you are using the latest versions of them. The gradle plugins are placed in the build.gradle file of the project. Other versions are in the build.gradle file of the module. … 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

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

How to configure gradle to work “offline” (using cached dependencies)

Gradle does a good job of avoiding re-downloading artifacts, but you can pass –offline to Gradle to prevent from accessing the network during builds. e.g. gradle –offline build If it needs something from the network that it doesn’t have, instead of attempting to fetch it, your build will fail.