-
-
Save youxiachai/5608223 to your computer and use it in GitHub Desktop.
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') | |
} | |
} |
不错,谢谢 ;-)
marked
你好,我使用你的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')
}
}
请帮我解决一下
楼上的可能是电脑的gradle版本与gradle plugin的版本不对应的原因 改为 classpath 'com.android.tools.build:gradle:0.9.+' 试试
nice ! thx very much~
学习了,真不错
marked !And tks !
marked!3Q!
thank you
tks
marked!3Q!
nice
nice
marked !And tks !