Android Studio Development Groovy

Source: Internet
Author: User

Context:

The main thing about Android Studio is how to develop groovy, the environment, the most disgusting. I have checked more than n foreign languages ....

1.AS (Android Studio) natively supports groovy, and Gradle's syntax is groovy. You can also create a. Groovy suffix document directly in as.

2.Project, module Build.gradle can change the display form of the directory to Android to identify:

Problem:

The groovy files that are executed will prompt for no configuration (configure) Groovy

Workaround:

1. In the project layer Build.gradle, add:

Buildscript {    repositories {        jcenter ()    }    dependencies {        ' Com.android.tools.build:gradle : 1.1.0        'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6 '          //Note:do not place your application dependencies here; they belong         //In the individual module Build.gradle files    }}

That is, on the original basis, add

' org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6 '

2. Add the Build.gradle in the module layer

plugin ' groovyx.grooid.groovy-android '
dependencies {    Compile filetree (dir' Libs 'include: [' *.jar '])    ' com.android.support:appcompat-v7:21.+ ' org.codehaus.groovy:groovy:2.4.0:grooid '     }
That means adding a plugin and adding a compile to dependencies.


3. To use the latest Android STUDIO1.2BETA3

Because I used to be old, resulting in the inability to run.


4. Turn over the wall:

This is not required, but may be affected when installing groovy's dependencies and as upgrades. No way celestial technology, management is inferior to people. With a VPN on the line, the main Baidu search for the first VPN is basically fake, the domain names have been the fake squatting.


Source:

Source on my github address is: https://github.com/AlbertSnow/MyGroovyProject.git

File is App\src\androidtest\java\com\example\starlight\myapplication\groovytest.groovy




Android Studio Development Groovy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.