Configure Gradle with Eclipse to pack Android programs under Mac

Source: Internet
Author: User

1. Download Gradle bin
http://gradle.org/gradle-download/

2. Configure Gradle,
http://www.douban.com/note/311599602/
Http://redfinsolutions.com/blog/creating-bashprofile-your-mac

gradle_home=/users/changfeng/bin/gradle-2.7;
Export Gradle_home
Export path= $PATH: $GRADLE _home/bin
Note that the Elcipse configuration generates a reference Gradle_user_home, and you can change the gradle_home to gradle_user_home with an environment variable

3.eclipse using Multidex and Gradle to pack Android apps
Http://wenku.baidu.com/link?url=Dezg0fbS55C2-eQzVMIfLsynb-jMxf1GbTivcnsrI5HpYd_yU-BOlUFxbYU4EJ59Z_ Ozewfkzussnzna5rd7a0ye5nxwsnnlf-0butdc2r7

Android:name= "Android.support.multidex.MultiDexApplication"

4.keystore account password
Chenhongwei 111111

5.gradle Packing exception

Buildscript {
repositories {
Mavencentral ()
}
dependencies {
Classpath ' com.android.tools.build:gradle:1.1.+ '//change to 1.1.+ version
}
}


Apply plugin: ' Android '

dependencies {
Compile Filetree (dir: ' Libs ', include: ' *.jar ')
}

Android {
Compilesdkversion 17
Buildtoolsversion "21.1.2"

sourcesets {
Main {
Manifest.srcfile ' Androidmanifest.xml '
Java.srcdirs = [' src ']
Resources.srcdirs = [' src ']
Aidl.srcdirs = [' src ']
Renderscript.srcdirs = [' src ']
Res.srcdirs = [' res ']
Assets.srcdirs = [' Assets ']
}

Move the tests to Tests/java, tests/res, etc ...
Instrumenttest.setroot (' tests ')

//Move The build types to Build-types/<type>
//For instance, Build-types/debug/java, Build-types/debug/and Roidmanifest.xml, ...
//This moves them out of them default location under src/<type>/... which would
//conflict with Src/bein G used by the main source set.
//Adding New build types or product flavors should be accompanied
//by a similar customization.
Debug.setro OT (' build-types/debug ')
Release.setroot (' Build-types/release ')
}


Signingconfigs {///signature, The file name and password are wrong, and there will be externally imported statements
Myconfig {
//absolute path and relative path can be
StoreFile file ("/users/changfeng/documents/ Keystore/qqgamezhu ")//signature file
Storepassword" 111111 "//Password
Keyalias" Chenhongwei "
Keypassword" 111111 "
}< br>}

buildtypes{
Release {
1. Add a signature
Signingconfig Signingconfigs.myconfig
2.runProguard Execution Obfuscation Code
Runproguard false
Obfuscation rule File
Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' proguard-project.txt '
}
}

}


#Wed APR 15:27:10 PDT 2013
Distributionbase=gradle_home
Distributionpath=wrapper/dists
Zipstorebase=gradle_home
Zipstorepath=wrapper/dists
Distributionurl=http\://services.gradle.org/distributions/gradle-1.12-all.zip

Configure Gradle with Eclipse to pack Android programs under Mac

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.