Android-Studio upgraded from 0.1.9 to 0.2.0 causing gradle build errors now

Solution for me without reinstalling or creating a new project: Step 1: Change line in build.gradle from: dependencies { classpath ‘com.android.tools.build:gradle:0.4’ } to dependencies { classpath ‘com.android.tools.build:gradle:0.5.+’ } Note: for newer versions of gradle you may need to change it to 0.6.+ instead. Step 2: In the <YourProject>.iml file, delete the entire<component name=”FacetManager”>[…]</component> tag. Step … Read more

~/.gradle/gradle.properties file not being read

The problem was that I made an assumption that wasn’t true. If you look at section 14.2 of the gradle documentation, it says: You can place a gradle.properties file in the Gradle user home directory (defined by the “GRADLE_USER_HOME” environment variable, which if not set defaults to USER_HOME/.gradle) or in your project directory. My incorrect … Read more

build.gradle is not part of the build defined by settings file

I was running into the exact same issue: org.gradle.api.InvalidUserDataException: Project directory ‘Users/Shared/myProject/theDirectory/src/test is not part of the build defined by settings file ‘Users/Shared/myProject/theDirectory/settings.gradle. The issue was I was running gradle from a terminal window that was based too far down in the directory structure. The FIX: simply Change Directories in the terminal window cd .. … Read more

Gradle: compile tests but do not run them

TL;DR: gradle testClasses compiles the test source code. The tasks for compiling the test source code will not be needed when the test-task is excluded. Gradle sees that and won’t execute the unneeded tasks. Here is the task dependency graph, when you exclude something all tasks that arent needed for other tasks will be dropped. … Read more

Gradle: What is the benefit if I switch from Groovy to Kotlin?

Kotlin is statically typed, whereas Groovy is not. Statically typed languages like Kotlin enable IDEs to support particular tasks much better: auto-completion and content assist quick documentation navigation to source refactoring and more This is a great advantage that Gradle sees and therefore started with Kotlin as an alternative to Groovy. There are also some … Read more

What is the difference between an app dependency and a module dependency/plugin?

Three things. There’s Gradle plugins, module dependencies, and build dependencies which are placed on the classpath of the build tool (Gradle daemon itself). A plugin is how Gradle knows what tasks to use. There are many plugins. For more info, see Gradle – Plugin Documentation A dependency is a library that is compiled with your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)