Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
signingConfigs {
myConfig{
storeFile file("gradle.keystore")
storePassword "gradle"
keyAlias "gradle"
keyPassword "gradle"
}
}
buildTypes{
release {
signingConfig signingConfigs.myConfig
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
signingConfigs {
myConfig{
storeFile file("gradle.keystore")
storePassword "gradle"
keyAlias "gradle"
keyPassword "gradle"
}
}
buildTypes{
release {
signingConfig signingConfigs.myConfig
runProguard true
proguardFile 'proguard-android.txt'
}
}
productFlavors {
playstore {
packageName='com.youxiachai.androidgradle.playstore'
}
hiapk {
packageName='com.youxiachai.androidgradle.amazonappstore'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
hiapk {
manifest.srcFile 'hiapk/AndroidManifest.xml'
}
playstore {
manifest.srcFile 'hiapk/AndroidManifest.xml'
}
instrumentTest.setRoot('tests')
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17"
defaultConfig {
minSdkVersion 8
targetSdkVersion 17
}
signingConfigs {
myConfig{
storeFile file("androidkey")
storePassword "a402091838"
keyAlias "pettrygirl"
keyPassword "a402091838"
}
}
buildTypes{
release {
signingConfig signingConfigs.myConfig
runProguard true
proguardFile 'proguard-android.txt'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
}
}
@healthy-tree

This comment has been minimized.

Copy link

@healthy-tree healthy-tree commented Jul 22, 2013

marked !And tks !

@venlentine

This comment has been minimized.

Copy link

@venlentine venlentine commented Oct 5, 2013

marked !And tks !

@flyingzl

This comment has been minimized.

Copy link

@flyingzl flyingzl commented Nov 6, 2013

不错,谢谢 ;-)

@shendawei

This comment has been minimized.

Copy link

@shendawei shendawei commented Nov 24, 2013

marked

@OsBelief

This comment has been minimized.

Copy link

@OsBelief OsBelief commented Dec 21, 2013

你好,我使用你的gradle教程构建在eclipse中开发的android应用时,出现了一下问题
FAILURE: Build failed with an exception.

  • Where:
    Build file 'E:\eclipse4.2\AndroidStorage\build.gradle' line: 9

  • What went wrong:
    A problem occurred evaluating root project 'AndroidStorage'.

    Could not create plugin of type 'AppPlugin'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

BUILD FAILED

Total time: 5.083 secs

build.gradle如下:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'

dependencies {
compile files('libs/android-support-v4.jar')
}

android {
compileSdkVersion 18
buildToolsVersion "18"

defaultConfig {
    minSdkVersion 8
    targetSdkVersion 18
}

signingConfigs {
    myConfig{
        storeFile file("gradle.keystore")
        storePassword "gradle"
        keyAlias "gradle"
        keyPassword "gradle"
    }
}

 buildTypes{
    release {
        signingConfig  signingConfigs.myConfig
    }
}


sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        resources.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    instrumentTest.setRoot('tests')
}

}
请帮我解决一下

@Runtime007

This comment has been minimized.

Copy link

@Runtime007 Runtime007 commented Mar 11, 2014

楼上的可能是电脑的gradle版本与gradle plugin的版本不对应的原因 改为 classpath 'com.android.tools.build:gradle:0.9.+' 试试

@knighttools

This comment has been minimized.

Copy link

@knighttools knighttools commented Mar 31, 2014

nice ! thx very much~

@jersuen

This comment has been minimized.

Copy link

@jersuen jersuen commented May 28, 2014

学习了,真不错

@Kellen-kl

This comment has been minimized.

Copy link

@Kellen-kl Kellen-kl commented Oct 13, 2014

marked !And tks !

@cscwhw

This comment has been minimized.

Copy link

@cscwhw cscwhw commented Oct 24, 2014

marked!3Q!

@ashank

This comment has been minimized.

Copy link

@ashank ashank commented Jan 21, 2015

thank you

@zhengjiong

This comment has been minimized.

Copy link

@zhengjiong zhengjiong commented Jun 25, 2015

tks

@abner0914

This comment has been minimized.

Copy link

@abner0914 abner0914 commented Jul 1, 2015

marked!3Q!

@XAVlER-S

This comment has been minimized.

Copy link

@XAVlER-S XAVlER-S commented Jul 15, 2015

nice

@saiwei13

This comment has been minimized.

Copy link

@saiwei13 saiwei13 commented Dec 26, 2015

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment