作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在这里遵循基本的Gradle Android教程:https://github.com/jvoegele/gradle-android-plugin
但是在运行gradle组装时出现以下错误:
* What went wrong:
A problem occurred evaluating root project 'MyAndroidApp'.
> Problem: failed to create task or type gettype
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
1 buildscript {
2 repositories {
3 mavenCentral()
4 }
5
6 dependencies {
7 classpath 'org.gradle.api.plugins:gradle-android-plugin:1.2.1'
8 }
9 }
10
11 apply plugin: 'android'
12 repositories {
13 mavenCentral()
14 }
15
16 version = "1.0.1"
17
18 androidSignAndAlign {
19 // skip signing configuration
20 }
21
22 // Configure filtering resources with properties from Gradle's project scope
23 processResources {
24 expand (project.properties)
25 }
26
27 // Configure the debug build
28 task configureDebug << {
29 jar.classifier = "debug"
30 }
31
32 // Configure the release build
33 task configureRelease << {
34 proguard.enabled = true
35 }
├── AndroidManifest.xml
├── ant.properties
├── bin
├── build.gradle
├── build.xml
├── libs
├── local.properties
├── proguard-project.txt
├── project.properties
└── src
└── main
├── java
│ └── my
│ └── android
│ └── package
│ └── MyAndroidActivity.java
└── res
├── layout
│ └── main.xml
└── values
└── strings.xml
11 directories, 10 files
最佳答案
对于其他有相同问题的人,如上面的Greg所述,切换到正式的Google Android Gradle插件应该可以:
http://tools.android.com/tech-docs/new-build-system/user-guide
我认为此问题中使用了许多非官方版本,因为在搜索Android Gradle插件时,它在搜索结果中的排名很高。
关于android - Gradle构建失败: “occurred evaluating root project…failed to create a task or type gettype”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17560654/
我是一名优秀的程序员,十分优秀!