Tom*_*rry 66 android android-studio android-gradle-plugin
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/bin/java "- com.intellij.rt.execution.application.AppMain org.gradle.launcher.GradleMain --build-file /Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/Tom/Documents/Git_open_sources/android-material-drawer-template/app/build.gradle' line: 16
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method runProguard() for arguments [false] on BuildType_Decorated{name=release, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, applicationIdSuffix=null, versionNameSuffix=null, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}.
* 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: 6.741 secs
Process finished with exit code 1
Run Code Online (Sandbox Code Playgroud)
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
applicationId "com.poliveira.apps.materialtests"
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.0'
//noinspection GradleDependency
compile "com.android.support:appcompat-v7:21.0.0"
compile 'com.android.support:recyclerview-v7:21.0.0'
}
Run Code Online (Sandbox Code Playgroud)
Saz*_*zid 178
在将android studio更新为1.0 RC 3后,我遇到了同样的问题.我无法将我的项目导入到新版本.我不得不创建一个新项目,并手动将文件从上一个项目添加到新项目中.
之后我发现gradle构建文件发生了变化.
这是改变:
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Run Code Online (Sandbox Code Playgroud)
而不是"runProguard false"使用"minifyEnabled false"
Gau*_*sch 32
Android Studio有更新,您需要迁移Gradle配置:http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0
不要在gradle文件中使用runProguard,而是尝试使用minifyEnabled.这应该解决问题.runProguard已弃用,很快就会停止工作.
注 - 要使用minifyEnabled,gradle应更新为2.2或更高版本.
适用于我(更新到1.0"最终"后):
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Run Code Online (Sandbox Code Playgroud)
还应该更新:Gradle 2.2(或更高版本),"SDK-Tools",支持存储库,支持库,Play服务等,
| 归档时间: |
|
| 查看次数: |
52577 次 |
| 最近记录: |