2017-06-27 1 views
0

Ich befolge das Gradle Tutorial auf https://guides.gradle.org/building-android-apps/. SO ist der letzte Teil ein Build Scan ausführen. Ich mache genau das, was ich von mir verlangte. aber das Android Studio sagt immer wieder "Fehler: (14, 0) Konnte die unbekannte Eigenschaft 'com' für das Root-Projekt 'HelloWorldGradle' vom Typ org.gradle.api.Project nicht bekommen."Build Scan funktioniert nicht für Gradle in Android

hier ist meine Top-Level-Build-Datei (build.gradle (Projekt: HelloWorldGradle)):

// Top-level build file where you can add configuration options common to all  sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
     maven { url 'https://plugins.gradle.org/m2' } 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.4.0-alpha7' 
     classpath 'com.gradle:build-scan-plugin:1.7.1' 
    } 
} 

apply plugin: com.gradle.build-scan 

buildScan { 
    licenseAgreementUrl = 'https://gradle.com/terms-of-service' 
    licenseAgree = 'yes' 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

Antwort

0

Das Problem ist mit der folgenden Zeile in Ihrem build.gradle:

apply plugin: com.gradle.build-scan

Sie benötigen zu aktualisieren als

apply plugin: 'com.gradle.build-scan' 

Eine andere Sache, die Sie beachten müssen, ist IMMER setzen Sie die com.gradle.build-scan Plugin als allererstes ein, wie folgt aus:

apply plugin: 'com.gradle.build-scan' 
apply plugin: 'java' 

Andernfalls würden Sie dies sehen:

WARNING: The build scan plugin was applied after other plugins. The captured data is more comprehensive when the build scan plugin is applied first.

Please see https://gradle.com/scans/help/plugin-late-apply for how to resolve this problem.

Lassen Sie mich wissen, ob das funktioniert.

Verwandte Themen