Gradle Bauen Gescheitert: "auftrat Auswertung von Stamm-Projekt schei...um eine Aufgabe zu erstellen, oder geben Sie "gettype"

Ich bin nach dem basic-Gradle Android tutorial hier: https://github.com/jvoegele/gradle-android-plugin

Aber bekomme die folgende Fehlermeldung beim ausführen von gradle assemble:

* 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.

Den code in meinen zu bauen.gradle-Datei:

  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 }

und mein Projekt Struktur:

├── 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

Fand ich die folgende Frage, die scheint ähnlich zu sein, aber die Updates funktionieren nicht:
Fehler beim erstellen android-Projekt mit gradle

Ich bin sehr gespannt, nicht nur, wie das problem zu lösen, sondern auch, wie um zu Debuggen (der stack-traces sind Hinweis so hilfreich, wie ich gehofft).

  • Ich schlage vor, zu versuchen, die offizielle Google-unterstützt Gradle-plugin. Es wird am Ende als die Standard-build-system für die Zukunft. tools.android.com/tech-docs/new-build-system/user-guide
  • Dank Greg, mit dem offiziellen Google-unterstützte plugin und alles funktioniert!
InformationsquelleAutor ZenBalance | 2013-07-10
Schreibe einen Kommentar